Skip to content

Update to Symfony 8.1#243

Merged
TavoNiievez merged 1 commit into
Codeception:mainfrom
TavoNiievez:update-symfony-8.1
Jun 27, 2026
Merged

Update to Symfony 8.1#243
TavoNiievez merged 1 commit into
Codeception:mainfrom
TavoNiievez:update-symfony-8.1

Conversation

@TavoNiievez

@TavoNiievez TavoNiievez commented Jun 26, 2026

Copy link
Copy Markdown
Member

Bumps the highest supported Symfony line from 8.0 to 8.1 across the module.

Changes

  • composer.json — bump every require-dev Symfony constraint from ^8.0 to ^8.1.
  • .github/workflows/main.yml — matrix row, exclude entry, the version-pinning sed, the quality-checks gate, and the coverage condition move from 8.0 to 8.1.
  • readme.md — supported-versions line now reads 8.1.x.
  • src/Codeception/Module/Symfony.php — docblock heading updated to 8.1.
  • tests/_app/Doctrine/DoctrineSetup.php — enable Doctrine native lazy objects on PHP 8.4+ (see below).

Why symfony/var-exporter needs special handling

symfony/var-exporter 8.x removed the LazyGhost trait (PHP 8.4 ships native lazy objects), and symfony/cache 8.1 requires var-exporter ^8.1. So the Symfony 8.1 row installs var-exporter 8.x for the first time — under 8.0 the module capped var-exporter at ^7.4, so the 8.0 row actually ran var-exporter 7.4 (with LazyGhost) and never exercised this.

Without LazyGhost, Doctrine's EntityManager construction fails with Symfony LazyGhost is not available. Please install the "symfony/var-exporter" package version 6.4 or 7 ... or enable PHP 8.4 native lazy objects. Two changes keep every matrix row green:

  1. The test app calls Configuration::enableNativeLazyObjects(true) on PHP 8.4+ (guarded by PHP_VERSION_ID and method_exists), so Doctrine uses PHP's native lazy objects instead of the removed trait. PHP 8.2/8.3 rows keep using LazyGhost from a <= 7.4 var-exporter.
  2. var-exporter keeps a floating constraint (^6.4 | ^7.4 | ^8.1) rather than being pinned to the row version, because doctrine/orm requires it >= 6.3.9 and it can therefore never be installed at 5.4.*. Each symfony/cache version still caps it to a compatible range:
Matrix row resolved var-exporter lazy mechanism
5.4 6.4 LazyGhost
6.4 7.4 LazyGhost
7.4 8.1 (PHP 8.4+) / 7.4 (PHP 8.2) native / LazyGhost
8.1 8.1 native

All 7 matrix jobs (PHP 8.2 & 8.5 × Symfony 5.4/6.4/7.4/8.1) pass.

Bump the highest supported Symfony line from 8.0 to 8.1 across the module:
the require-dev constraints, the CI matrix and version-pinning sed, the readme
requirements, and the module docblock.

symfony/var-exporter needs special handling. Its 8.x release removed the
LazyGhost trait (PHP 8.4 ships native lazy objects), and symfony/cache 8.1
requires var-exporter ^8.1, so the Symfony 8.1 row installs var-exporter 8.x
for the first time. Two changes keep every matrix row working:

* The test app enables Doctrine native lazy objects on PHP 8.4+
  (Configuration::enableNativeLazyObjects), since the LazyGhost trait it
  previously relied on is gone in var-exporter 8.x.
* var-exporter keeps a floating constraint (^6.4 | ^7.4 | ^8.1) instead of
  being pinned to the row version, because doctrine/orm requires it to be
  >= 6.3.9 and it therefore can never be installed at 5.4.*. Each
  symfony/cache version still caps it to a compatible range (5.4 -> 6.4,
  6.4 -> 7.4, 7.4 -> 8.1, 8.1 -> 8.1).
@TavoNiievez TavoNiievez merged commit 558c038 into Codeception:main Jun 27, 2026
7 checks passed
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.

1 participant