Skip to content

Add PHP 8.5 and Symfony 8 support#328

Closed
HecFranco wants to merge 13 commits intoliip:2.xfrom
HecFranco:feature/php85-symfony8
Closed

Add PHP 8.5 and Symfony 8 support#328
HecFranco wants to merge 13 commits intoliip:2.xfrom
HecFranco:feature/php85-symfony8

Conversation

@HecFranco
Copy link
Copy Markdown
Contributor

Summary

Adds support for PHP 8.5 and Symfony 8.x so the bundle can be used on the latest runtimes. Upgrades are independent: projects can adopt either, both, or stay on current versions.

Changes

PHP 8.5

  • Bump laminas/laminas-diagnostics from ^1.9 to ^1.28 so Composer can resolve a version that supports PHP 8.5 (1.27.x only supports up to 8.4).
  • Add PHP 8.5 to the CI matrix.

Symfony 8

  • Extend Symfony constraints to ^8.0 for:
    • symfony/framework-bundle
    • Dev components: asset, browser-kit, expression-language, finder, mailer, messenger, phpunit-bridge, twig-bundle
  • Add Symfony 8.0.* to the CI matrix.
  • Restrict Symfony 8 jobs to PHP 8.4+ (Symfony 8 requirement); excluded for PHP 8.1, 8.2, 8.3.

CI

  • Fix dependency-versions to use matrix.deps instead of inputs.deps.
  • Normalise composer.json formatting (indent, key order).

Testing

  • composer.json remains valid; existing PHP 8.1–8.4 and Symfony 6.4/7.x combinations unchanged.
  • CI runs with PHP 8.1–8.5 and Symfony 6.4, 7.2, 7.3, 8.0 as applicable.

Notes

  • Stacked PR: This PR is based on feature/replace-deprecated-xml. Merge that branch first, then change this PR's base to main and merge.

…bility)

- Migrate all service definitions from XML to PHP format
- Migrate routing from XML to YAML
- Update LiipMonitorExtension and MailerCompilerPass to use PhpFileLoader
- Update README with new routing.yaml reference

XML configuration is deprecated in Symfony 7.4 and will be removed in Symfony 8.0.
This change ensures bundle compatibility with upcoming Symfony versions.
@HecFranco
Copy link
Copy Markdown
Contributor Author

Ready for review. This PR adds PHP 8.5 and Symfony 8 support with minimal, backward-compatible changes (constraints + CI).

Merge order: Please merge #327 first (it’s the base branch for this PR). Once #327 is in, I’ll retarget this PR to main and it can be merged right after. Thanks.

- Downgrade laminas/laminas-diagnostics to version 1.27 in composer.json
- Expand version constraints for doctrine packages in require-dev
- Add PHP 8.5 and Symfony 6.4 support in CI workflow, noting compatibility issues with laminas-diagnostics 1.28+
- Update CI configuration to handle Symfony 8.0 compatibility by removing incompatible dev dependency.
- Adjust dependency installation process based on Symfony version.
- Skip tests related to security advisory if the optional dependency is not installed.
- Mark tests as incompatible with Symfony 8 where necessary.
- Add validation step in CI to ensure composer.json constraints are met for PHP 8.1 and Symfony 6.4 compatibility.
- Enforce specific version requirements for laminas/laminas-diagnostics and restrict usage of enlightn/security-checker in require-dev.
- Introduce phpunit-symfony8.xml.dist for Symfony 8 CI jobs.
- Update CI workflow to use the new PHPUnit configuration file.
- Mark tests as incompatible with Symfony 8 where necessary to ensure proper test execution.
- Introduce config_symfony8.yml to define framework and liip_monitor settings for Symfony 8 compatibility.
- Ensure the structure aligns with Symfony 7.x for consistency in testing.
- Include symfony/yaml in composer.json to support YAML parsing in Symfony 8.
- Ensure compatibility with existing Symfony dependencies.
@ceesvanegmond
Copy link
Copy Markdown

Would be great if you can support SF8 @kbond

@HecFranco
Copy link
Copy Markdown
Contributor Author

Hi! Thanks again for maintaining this bundle.

I just wanted to kindly follow up on Symfony 8 support. There is already visible community interest for PHP 8.5 / Symfony 8 compatibility (#322), and this PR aims to provide that while keeping existing supported versions unchanged.

If the current PR is difficult to review because it depends on #327, I’d be happy to split it differently or open a smaller follow-up PR to make merging easier.

In any case, if there are blockers or changes you would like to see, I’d really appreciate a quick note and I can adjust the PR accordingly. Thanks again for your time.

Copy link
Copy Markdown
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for getting this started. i am doing some cleanups in #329

run: |
RAW=$(cat composer.json | tr -d '\n')
if echo "$RAW" | grep -qE 'laminas-diagnostics[^"]*"\^1\.28"'; then
echo "::error::composer.json must use laminas/laminas-diagnostics ^1.27 (not ^1.28) for PHP 8.1 and Symfony 6.4 compatibility."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be discovered by the build of php 8.1 with symfony 6.4, no need to have this here.

exit 1
fi
if echo "$RAW" | grep -q '"require-dev"[^}]*"enlightn/security-checker"'; then
echo "::error::enlightn/security-checker must be in suggest only, not in require-dev. Remove it from require-dev."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd rather not have this check here either. review should catch this.

php -r "
\$j = json_decode(file_get_contents('composer.json'), true);
unset(\$j['require-dev']['matthiasnoback/symfony-dependency-injection-test']);
file_put_contents('composer.json', json_encode(\$j, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meanwhile supports symfony 8. the proper way to remove a package would be through composer, not hacking around on the composer.json file.

SYMFONY_REQUIRE: ${{ matrix.symfony }}

- name: Install dependencies (Symfony 8)
if: matrix.symfony == '8.0.*'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this and use the simplified step for everything

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid a BC break, we still need to provide the file. i will just add it back, and keep routing.php include the yaml file instead of the xml file to work with symfony 8

@dbu dbu mentioned this pull request Mar 23, 2026
@dbu
Copy link
Copy Markdown
Member

dbu commented Mar 23, 2026

fixed in #239

@dbu dbu closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants