Skip to content

Feat/symfony 6 php 8.3 8.5 - #26

Merged
simonhard merged 7 commits into
php-vcr:masterfrom
simonhard:feat/symfony-6-php-8.3-8.5
Apr 12, 2026
Merged

Feat/symfony 6 php 8.3 8.5#26
simonhard merged 7 commits into
php-vcr:masterfrom
simonhard:feat/symfony-6-php-8.3-8.5

Conversation

@simonhard

Copy link
Copy Markdown
Contributor

Add Symfony 6.4 and PHP 8.1–8.5 support

No runtime code changes. All changes are limited to dependency constraints,
CI configuration, and test tooling.


Why now?

Component Status
PHP 7.x EOL since November 2022
Symfony 4 EOL since November 2023
Symfony 6.4 Current LTS (until November 2027)
PHP 8.3 Stable since November 2023
PHP 8.4 Stable since November 2024
PHP 8.5 RC (due November 2025)

Test matrix

Before:

PHP Symfony
7.2, 7.3, 7.4, 8.0, 8.1, 8.2 4.4.*, 5.4.*

After:

PHP Symfony
8.1, 8.2, 8.3, 8.4, 8.5* 5.4.*, 6.4.*

* PHP 8.5 rows use continue-on-error: true until GA.


Changes

composer.json

  • php: ^7.2|^8^8.1
  • All symfony/*: ^4|^5^5.4|^6.4
  • Remove symfony/polyfill-php80 (redundant at PHP 8.1+)
  • phpunit/phpunit: ^8.5|^9.5^9.6|^10.5
  • symfony/phpunit-bridge: ^4.4|^5.4^5.4|^6.4
  • dms/phpunit-arraysubset-asserts: allow ^0.5 (PHPUnit 10 support)

phpunit.xml.dist

  • Replace deprecated <filter><whitelist> with <source><include> (PHPUnit 10 schema)
  • Drop <listeners> block (symfony/phpunit-bridge 5.4+ auto-registers via bootstrap)

.github/workflows/continuous-integration.yml

  • Expand PHP/Symfony matrix as described above
  • ubuntu-20.04ubuntu-latest
  • actions/checkout@v2@v4
  • ramsey/composer-install@v1@v3
  • mikepenz/action-junit-report@v2@v4

src/Test/VCRTestCaseTrait.php

PHPUnit 10 removed TestCase::getName(). Replaced with name() + dataName(),
with a backwards-compatible fallback for PHPUnit 9:

if (method_exists($this, 'getName')) {
    $name = $this->getName($withDataSet);   // PHPUnit < 10
} else {
    $name = $this->name();                  // PHPUnit 10+
    if ($withDataSet && '' !== (string) $this->dataName()) {
        $name .= '-' . $this->dataName();
    }
}

tests/Functional/ConfigurationTest.php

Symfony 6.4's FrameworkExtension throws when buildContainer() is called on an
already-booted kernel, because the config has already been read and frozen during
the initial boot.

Before: bootKernel() → get static::$kernel → call buildContainer() again → error
After: create a fresh unbooted kernel → initializeBundles()buildContainer()


Breaking change

This is a minimum-requirements bump. Consumers pinned to PHP 7.x or Symfony 4
should stay on 2.1.x. If you prefer to keep master on the old floor and ship
this as a 3.x branch, I am happy to rebase.


Checklist

  • composer update with SYMFONY_REQUIRE=6.4.* resolves cleanly
  • Full test suite green on PHP 8.3 × Symfony 6.4 (PHPUnit 10.5)
  • Full test suite green on PHP 8.3 × Symfony 5.4 (PHPUnit 10.5)
  • No runtime source files modified

Simon Huebner added 7 commits April 12, 2026 07:43
- Widen all symfony/* constraints to ^5.4|^6.4
- Raise PHP floor to ^8.1 (required by Symfony 6.4, PHP 7.x EOL)
- Remove symfony/polyfill-php80 (redundant at PHP 8.1+)
- Bump phpunit/phpunit to ^9.6|^10.5
- Bump symfony/phpunit-bridge to ^5.4|^6.4
- Allow dms/phpunit-arraysubset-asserts ^0.5 (PHPUnit 10 support)
- Replace deprecated <filter><whitelist> with <source><include>
- Drop <listeners> block (symfony/phpunit-bridge 5.4+ auto-registers)
- Add xsi:noNamespaceSchemaLocation for schema validation
- Add PHP 8.3, 8.4, 8.5 to test matrix (drop PHP 7.2-8.0)
- Add Symfony 6.4.* to matrix, drop 4.4.*
- Mark PHP 8.5 rows continue-on-error until GA
- Bump actions: checkout@v4, ramsey/composer-install@v3, action-junit-report@v4
- Switch to ubuntu-latest (ubuntu-20.04 retired)
- Remove dead php-version != 7.1 guard
- VCRTestCaseTrait: replace removed getName() with name()/dataName()
  for PHPUnit 10+, keeping backwards-compat fallback for PHPUnit 9
- ConfigurationTest: create fresh unbooted kernel before calling
  buildContainer() to avoid SF 6.4 double-compilation error
  (FrameworkExtension forbids re-processing already-read config)
- phpunit.xml.dist: remove <source> element (PHPUnit 10+ only; causes
  validation warning with PHPUnit 9.6 and is unused without --coverage)
- composer.json: bump php-vcr/php-vcr floor from ^1.5 to ^1.6; 1.5.x
  uses is_resource() on curl handle which always returns false on PHP 8+
  where curl_init() returns a CurlHandle object instead of a resource
@simonhard
simonhard merged commit babbe64 into php-vcr:master Apr 12, 2026
12 checks passed
@simonhard

Copy link
Copy Markdown
Contributor Author

@K-Phoen please update packagist or add a packagist api-token to the repo. Thanks 🙏

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