Modernize for PHP 8.5/Twig 3/Symfony 7.4 — migrate templating to Twig, refactor DI/tests and add GitHub Actions CI - #4
Open
azine wants to merge 9 commits into
Conversation
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.
Motivation
Environmentfor clearer DI and testability.Description
TreeBuilderroot API inDependencyInjection/Configuration.phpand adjusted configuration key names used by the extension.Symfony Templatinghelper with a Twig-based helper by switchingTemplating/SocialBarHelperto acceptTwig\Environmentand rendering@AzineSocialBar/*templates.Templating/SocialBarTwigExtensionto extendTwig\Extension\AbstractExtension, exposeTwigFunctions, inject theSocialBarHelperservice, modernize argument handling, strict typing, and use\InvalidArgumentExceptionon bad input.Resources/config/services.ymlto inject@twiginto the helper and wire the extension to use the helper.composer.jsonto requirephp:^8.5, Symfony component packages^7.4,twig/twig:^3, switched autoloading to PSR-4, and updated dev dependencies to PHPUnit 11 andsymfony/yaml.PHPUnit\Framework\TestCase,symfony/yamlparsing, and updated assertions and mocks to reflect the new DI and helper wiring inTests/*.phpunit.xml.distfor PHPUnit 11 schema and updated coverage/source settings, removed oldtravis.php.ini, and added a GitHub Actions workflow.github/workflows/ci.ymlthat runscomposer validateand PHPUnit.README.mdto reflect new requirements, installation instructions, configuration examples, CI notes, and upgrade notes.Testing
vendor/bin/phpunit -c phpunit.xml.dist, and the unit tests completed successfully.composer validateandvendor/bin/phpunit -c phpunit.xml.distonpushandpull_request(CI configuration added).Codex Task