Skip to content

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
masterfrom
codex/upgrade-to-php-8.5-and-symfony-7.4
Open

Modernize for PHP 8.5/Twig 3/Symfony 7.4 — migrate templating to Twig, refactor DI/tests and add GitHub Actions CI#4
azine wants to merge 9 commits into
masterfrom
codex/upgrade-to-php-8.5-and-symfony-7.4

Conversation

@azine

@azine azine commented May 22, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Upgrade the bundle to modern PHP and Symfony stacks and remove legacy templating integration to keep compatibility with current projects.
  • Replace container-based rendering and legacy APIs with typed services and Twig Environment for clearer DI and testability.
  • Move test and tooling setup to recent PHPUnit and GitHub Actions standards.

Description

  • Migrated configuration API to the newer TreeBuilder root API in DependencyInjection/Configuration.php and adjusted configuration key names used by the extension.
  • Replaced legacy Symfony Templating helper with a Twig-based helper by switching Templating/SocialBarHelper to accept Twig\Environment and rendering @AzineSocialBar/* templates.
  • Refactored Templating/SocialBarTwigExtension to extend Twig\Extension\AbstractExtension, expose TwigFunctions, inject the SocialBarHelper service, modernize argument handling, strict typing, and use \InvalidArgumentException on bad input.
  • Updated service configuration in Resources/config/services.yml to inject @twig into the helper and wire the extension to use the helper.
  • Modernized composer.json to require php:^8.5, Symfony component packages ^7.4, twig/twig:^3, switched autoloading to PSR-4, and updated dev dependencies to PHPUnit 11 and symfony/yaml.
  • Revised tests to use PHPUnit\Framework\TestCase, symfony/yaml parsing, and updated assertions and mocks to reflect the new DI and helper wiring in Tests/*.
  • Reworked phpunit.xml.dist for PHPUnit 11 schema and updated coverage/source settings, removed old travis.php.ini, and added a GitHub Actions workflow .github/workflows/ci.yml that runs composer validate and PHPUnit.
  • Updated README.md to reflect new requirements, installation instructions, configuration examples, CI notes, and upgrade notes.

Testing

  • Ran the test suite with vendor/bin/phpunit -c phpunit.xml.dist, and the unit tests completed successfully.
  • Added a GitHub Actions workflow that runs composer validate and vendor/bin/phpunit -c phpunit.xml.dist on push and pull_request (CI configuration added).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant