-
Notifications
You must be signed in to change notification settings - Fork 3
PHP 8.5 #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.5 #411
Conversation
Deprecation: Auto-injection of the container for "\ForkCMS\App\ForkController" is deprecated since Symfony 4.2. Configure it as a service instead.
The "Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::getException()" method is deprecated since Symfony 4.4, use "getThrowable()" instead.
The Symfony\Bundle\TwigBundle\TwigEngine class is deprecated since version 4.3 and will be removed in 5.0; use \Twig\Environment instead.
Reviewer's GuideModernizes Fork CMS to run on PHP 8.1 with Symfony 5.4 component split, updates infrastructure (CI, Docker, deploy) to PHP 8.1, adapts kernel/event APIs and templating away from legacy Symfony bundles, and refactors several controllers/commands/tests to use dependency injection and newer Symfony utilities. Class diagram for updated Common_WebTestCase using KernelBrowserclassDiagram
class BaseWebTestCase {
}
class AppKernel {
}
class WebTestCase {
<<abstract>>
- static AppKernel kernel
+ static getKernelClass() string
+ static createClient(options array, server array) KernelBrowser
+ importSQL(database SpoonDatabase, sql string) void
+ resetDataBase(client KernelBrowser) void
+ loadFixtures(client KernelBrowser, fixtureClasses array) void
+ putParametersFileBack(filesystem Filesystem, kernelDir string) void
+ submitForm(client KernelBrowser, form Form, data array, setValues bool) void
+ submitEditForm(client KernelBrowser, form Form, data array) void
+ requestWithGetParameters(client KernelBrowser, url string, data array) Crawler
+ login(client KernelBrowser) void
+ logout(client KernelBrowser) void
+ assertIs404(client KernelBrowser) void
+ assertIs200(client KernelBrowser) void
+ assertGetsRedirected(client KernelBrowser, initialUrl string, expectedUrl string, requestMethod string, requestParameters array) void
+ assertPageLoadedCorrectly(client KernelBrowser, url string, expectedContent array, httpStatusCode int, requestMethod string, requestParameters array) void
+ assertClickOnLink(client KernelBrowser, linkText string, expectedContent array, httpStatusCode int, requestMethod string, requestParameters array) void
+ assertCurrentUrlContains(client KernelBrowser, partialUrls string...) void
+ assertCurrentUrlEndsWith(client KernelBrowser, partialUrl string) void
+ assertHttpStatusCode(client KernelBrowser, url string, httpStatusCode int, requestMethod string, requestParameters array) void
+ assertHttpStatusCode200(client KernelBrowser, url string, requestMethod string, requestParameters array) void
+ assertHttpStatusCode404(client KernelBrowser, url string, requestMethod string, requestParameters array) void
+ getFormForSubmitButton(client KernelBrowser, buttonText string, filterSelector string) Form
}
class KernelBrowser {
+ request(method string, uri string, parameters array, files array, server array, content string) Response
+ getContainer() ContainerInterface
+ getCrawler() Crawler
+ getHistory() BrowserHistory
+ setMaxRedirects(maxRedirects int) void
}
class SpoonDatabase {
+ execute(query string) void
+ getColumn(query string) array
+ drop(tables array) void
}
class Filesystem {
+ exists(path string) bool
}
class Form {
}
class Crawler {
}
BaseWebTestCase <|-- WebTestCase
WebTestCase --> AppKernel : uses
WebTestCase --> KernelBrowser : creates and uses
WebTestCase --> SpoonDatabase : uses
WebTestCase --> Filesystem : uses
WebTestCase --> Form : submits
WebTestCase --> Crawler : returns
Class diagram for Installer bundle controller and commands with dependency injectionclassDiagram
class AbstractController {
+ getParameter(name string) mixed
+ generateUrl(route string, parameters array, referenceType int) string
+ redirect(url string) RedirectResponse
+ render(view string, parameters array) Response
}
class InstallerController {
<<final>>
- static installationData InstallationData
- forkInstaller ForkInstaller
- requirementsChecker RequirementsChecker
+ __construct(forkInstaller ForkInstaller, requirementsChecker RequirementsChecker)
+ step1Action() Response
+ step6Action(request Request) Response
- getInstallationData(request Request) InstallationData
- checkInstall() void
- handleInstallationStep(request Request, step int, formType string) Response
}
class ForkInstaller {
+ install(installationData InstallationData) string
}
class RequirementsChecker {
- projectDir string
+ __construct(projectDir string)
+ passes() bool
+ hasErrors() bool
}
class PrepareForReinstallCommand {
<<Command>>
- database SpoonDatabase
- kernel KernelInterface
+ __construct(database SpoonDatabase, kernel KernelInterface)
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
- clearDatabase(io SymfonyStyle) int
- removeConfiguration(io SymfonyStyle) void
- clearCache(output OutputInterface, io SymfonyStyle) void
}
class Application {
+ __construct(kernel KernelInterface)
+ find(name string) Command
}
class KernelInterface {
}
class InstallationData {
}
class Request {
}
class Response {
}
class RedirectResponse {
}
class SpoonDatabase {
+ getColumn(query string) array
+ execute(query string) void
+ drop(tables array) void
}
class SymfonyStyle {
}
class InputInterface {
}
class OutputInterface {
}
class Command {
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
}
AbstractController <|-- InstallerController
InstallerController --> ForkInstaller : uses
InstallerController --> RequirementsChecker : uses
InstallerController --> InstallationData : builds
InstallerController --> Request : reads
InstallerController --> Response : returns
PrepareForReinstallCommand <|-- Command
PrepareForReinstallCommand --> SpoonDatabase : uses
PrepareForReinstallCommand --> KernelInterface : uses
PrepareForReinstallCommand --> Application : creates
Application --> KernelInterface : wraps
RequirementsChecker ..> projectDir : configured via services.xml
ForkInstaller ..> service_container : configured via services.xml
Class diagram for ForkController and application bootstrappingclassDiagram
class AbstractController {
+ getParameter(name string) mixed
+ render(view string, parameters array) Response
}
class ForkController {
- kernel KernelInterface
- applicationMapping array
+ __construct(kernel KernelInterface)
+ backendController() Response
+ backendAjaxController() Response
+ frontendController() Response
+ frontendAjaxController() Response
- handleApplication(application ApplicationInterface) Response
- initializeBackend(app string) string
- initializeFrontend(app string) string
}
class KernelInterface {
}
class BackendInit {
+ __construct(kernel KernelInterface)
+ initialize(app string) void
}
class FrontendInit {
+ __construct(kernel KernelInterface)
+ initialize(app string) void
}
class ApplicationInterface {
+ display() Response
}
class Backend {
+ __construct(kernel KernelInterface)
+ display() Response
}
class BackendAjax {
+ __construct(kernel KernelInterface)
+ display() Response
}
class Frontend {
+ __construct(kernel KernelInterface)
+ display() Response
}
class FrontendAjax {
+ __construct(kernel KernelInterface)
+ display() Response
}
class Response {
}
AbstractController <|-- ForkController
ForkController --> KernelInterface : injected
ForkController --> BackendInit : creates and uses
ForkController --> FrontendInit : creates and uses
ForkController --> Backend : bootstraps
ForkController --> BackendAjax : bootstraps
ForkController --> Frontend : bootstraps
ForkController --> FrontendAjax : bootstraps
BackendInit --> KernelInterface
FrontendInit --> KernelInterface
Backend ..|> ApplicationInterface
BackendAjax ..|> ApplicationInterface
Frontend ..|> ApplicationInterface
FrontendAjax ..|> ApplicationInterface
ForkController --> ApplicationInterface : handleApplication
Class diagram for Twig templating refactor away from TwigEngineclassDiagram
class BaseTwigTemplate {
- environment Environment
- debugMode bool
- forkSettings ModulesSettings
+ assign(key string, value mixed) void
+ display(template string) Response
+ getContent(template string) string
}
class Backend_TwigTemplate {
- debugMode bool
+ __construct(addToReference bool)
- buildTwigEnvironmentForTheBackend() Environment
}
class Frontend_TwigTemplate {
- forkSettings ModulesSettings
- language string
- debugMode bool
+ __construct(environment Environment)
}
class Environment {
}
class TemplateLocator {
}
class Model {
+ getContainer() ContainerInterface
}
class ModulesSettings {
}
class ContainerInterface {
+ get(id string) mixed
+ set(id string, service mixed) void
+ getParameter(name string) mixed
}
class Response {
}
BaseTwigTemplate <|-- Backend_TwigTemplate
BaseTwigTemplate <|-- Frontend_TwigTemplate
Backend_TwigTemplate --> Environment : builds
Backend_TwigTemplate --> Model : uses
Backend_TwigTemplate --> ContainerInterface : uses
Frontend_TwigTemplate --> Environment : injected
Frontend_TwigTemplate --> ModulesSettings : uses
Frontend_TwigTemplate --> Model : uses
BaseTwigTemplate --> Environment : holds
BaseTwigTemplate --> ModulesSettings : may use
Class diagram for updated console commands using dependency injectionclassDiagram
class Command {
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
}
class PrepareForReinstallCommand {
<<Command>>
+ const RETURN_SUCCESS : int
+ const RETURN_DID_NOT_REINSTALL : int
+ const RETURN_DID_NOT_CLEAR_DATABASE : int
- database SpoonDatabase
- kernel KernelInterface
+ __construct(database SpoonDatabase, kernel KernelInterface)
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
- clearDatabase(io SymfonyStyle) int
- removeConfiguration(io SymfonyStyle) void
- clearCache(output OutputInterface, io SymfonyStyle) void
}
class MediaGalleryDeleteAllCommand {
<<Command>>
- deleteMediaItems bool
- mediaGalleryRepository MediaGalleryRepository
- commandBus CommandBus
+ __construct(mediaGalleryRepository MediaGalleryRepository, commandBus CommandBus)
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
- checkOptions(input InputInterface) void
- deleteMediaGalleries() void
}
class CacheClearCommand {
<<Command>>
- clearAll bool
- fileManager FileManager
+ __construct(fileManager FileManager)
+ configure() void
+ execute(input InputInterface, output OutputInterface) int
- checkOptions(input InputInterface) void
- deleteCachedFolders() void
- getFoldersToDelete() array
}
class MediaGalleryRepository {
+ findAll() array
}
class CommandBus {
+ handle(command object) void
}
class DeleteMediaGallery {
+ __construct(mediaGallery MediaGallery)
}
class MediaGallery {
}
class FileManager {
+ deleteFolder(path string) void
}
class SpoonDatabase {
+ getColumn(query string) array
+ execute(query string) void
+ drop(tables array) void
}
class KernelInterface {
}
class SymfonyStyle {
}
class InputInterface {
}
class OutputInterface {
}
Command <|-- PrepareForReinstallCommand
Command <|-- MediaGalleryDeleteAllCommand
Command <|-- CacheClearCommand
PrepareForReinstallCommand --> SpoonDatabase : uses
PrepareForReinstallCommand --> KernelInterface : uses
MediaGalleryDeleteAllCommand --> MediaGalleryRepository : uses
MediaGalleryDeleteAllCommand --> CommandBus : uses
MediaGalleryDeleteAllCommand --> DeleteMediaGallery : creates
DeleteMediaGallery --> MediaGallery : wraps
CacheClearCommand --> FileManager : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
9c981f2 to
527dc30
Compare
7f2c880 to
2712205
Compare
ef761af to
bd8bf09
Compare
bd8bf09 to
03a57a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, we are unable to review this pull request
The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 538
PHP
Symfony