Refactor command handling to Pipeline middlewares#12
Merged
Conversation
…bootstrap the application
…le output for improved simplicity and maintainability
…ce, remove TJGConfig, and update references across the codebase
…t to 8.2, and adjust dependencies in composer configuration
…mprove Docker/Codeception configuration for compatibility with PHP 8.2 and lucatume/wp-browser ^4.5
…ndencies, and refine configuration for improved consistency
…sure proper file endings throughout the codebase
… parameters explicit
…ce, update references across codebase, and remove outdated namespace aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the CLI command execution flow around
italystrap/pipelinemiddlewares, updates the project baseline to PHP 8.2, and replaces Psalm static analysis with PHPStan.The branch is 13 commits ahead of
masterand touches 131 files with 828 additions and 1,439 deletions.Detailed changes
Command handling and application bootstrap
ItalyStrap\Busimplementation withitalystrap/pipeline.Infrastructure\Handler\ConsoleHandleras the console-facing handler that wraps a middleware pipeline and enforces integer command exit codes.InitCommand,DumpCommand,ValidateCommand, andInfoCommandto receive aConsoleHandlerinstead of direct domain handlers or the old bus interfaces.AsCommandattributes and command description constants for the CLI commands.Domain\Outputhandlers intoApplication\Middlewares:DumpInitInfoValidateSchemaJsonDeleteSchemaJsonModuleApplicationandModuleInfrastructureto register command factories, middleware wiring, finder aliases, and shared infrastructure services through the modularized Empress container.Bootstrapso it builds the container modules, configures a SymfonyContainerCommandLoader, and registers the CLI commands through the container.Public API and namespaces
ThemeJsonandSectionNamesinto theItalyStrap\ThemeJsonGenerator\Apinamespace.TJGConfigclass.InfoMessageinto the genericApplication\Messagevalue object and removesInitMessage.Helper\ConvertCasetoInfrastructure\Filesystem\ConvertCaseApplication\Commands\Utils\DataFromJsonTraittoInfrastructure\Filesystem\DataFromJsonTraitnamespace-bc-aliases.php.Runtime behavior
dumpnow processes PHP entrypoint files through the middleware pipeline, builds the local injector for theme configuration, writes generatedtheme.jsonfiles, and optionally writes SCSS files.initnow creates PHP entrypoint files from existing JSON files through the new middleware path.validatenow runs schema deletion, schema creation/refresh, and JSON validation as a middleware chain.theme.schema.jsonwhen missing or older than one week, and the--forceoption deletes the existing schema before recreation.infonow lists discovered JSON files through the middleware implementation.Dependencies and tooling
>=7.4to>=8.2.italystrap/pipelineandoverclokk/aurynas runtime dependencies.italystrap/empressto the modularized development alias.lucatume/wp-browserto^4.5and updates Codeception modules to current major versions.vimeo/psalmand addsphpstan/phpstan.phpstan.neonat level 9, including the Auryn injector stub instubs/auryn-injector.stuband excluding experimental classes from analysis.psalmtostan, and updates theqascript to run PHPStan.psalmtostan.CI, Docker, and test environment
actions/checkout@v4ramsey/composer-install@v3CItoTest.lucatume/wp-browsercommand and module namespaces.Tests and cleanup
SchemaJsonTestfor the new schema middleware.process()with a pipeline handler.Application\Middlewares\Dumpconstant.Api\ThemeJsonlocation.Validation
composer run stanpassed with PHPStan level 9.composer run unitpassed: 323 tests, 686 assertions.Notes
ItalyStrap\ThemeJsonGenerator\Api, Psalm commands/configuration were removed, and the old internalItalyStrap\Buscode was deleted.