Update PHPUnit to v11, raise PHP version to 8.2, and update Symfony support - #95
Merged
Conversation
Requires PHPUnit ^11.5 as the only supported version, dropping PHPUnit 8 and 9. Since PHPUnit 11 requires PHP 8.2, the CI test matrix is reduced to PHP 8.2-8.5. The runtime PHP requirement for tailor itself remains unchanged. Along with the update: * Convert @test/@dataProvider annotations to PHP attributes, as doc-comment metadata is deprecated and will be removed in PHPUnit 12 * Make data providers static, as required by PHPUnit 10+ * Migrate phpunit.xml.dist to the PHPUnit 11.5 schema and use the new cache directory * Remove ReflectionMethod/ReflectionProperty::setAccessible() calls in tests (no-op since PHP 8.1, deprecated in PHP 8.5) * Fix code style issue raised by updated php-cs-fixer
The PHP requirement is raised from ^7.2 || ^8.0 to ^8.2, matching the versions actively tested in CI since the update to PHPUnit 11. The CI workflow example in the README is updated accordingly.
The Symfony constraints are updated from ^5.4 || ^6.4 || ^7.0 to ^6.4 || ^7.4 || ^8.0 for all four used components. Since Application::add() was replaced by addCommand() in symfony/console 7.4 and removed in 8.0, the tailor binary now picks the available method at runtime to stay compatible with the whole supported version range. Verified with both the lowest (symfony 6.4.0) and highest (symfony 8.1) resolvable dependency set.
The dev-main fallback is no longer needed since v0.9.0 supports current PHP and php-cs-fixer versions. Also applies a coding style fix to the tailor binary.
Use Application::addCommands(), which exists in all supported symfony/console versions, and reference the local PHPUnit XSD to avoid maintaining a versioned schema URL.
eliashaeussler
approved these changes
Aug 1, 2026
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.
This pull request updates the project to require PHP 8.2 or higher and modernizes dependencies and test code. The main changes include raising the minimum PHP version, updating Symfony and PHPUnit dependencies, and refactoring test annotations to use PHP attributes.
Dependency and environment updates:
composer.json, and updated the supported Symfony package versions to^6.4 || ^7.4 || ^8.0(composer.json).^11.5and the coding standards package to^0.9incomposer.json..github/workflows/tests.ymlnow only tests against PHP 8.2 and above, dropping support for older PHP versions.README.mdCI example to 8.2.phpunit.xml.distto use the PHPUnit 11.5 schema and added a cache directory.Test modernization:
#[Test],#[DataProvider]) instead of docblock annotations for test methods and data providers [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29].Code quality and compatibility:
getBaseUri()inHttpClientFactoryfromprotectedtoprivateto better encapsulate the method.These changes ensure the codebase is compatible with modern PHP and Symfony versions, improves test reliability and readability, and removes support for legacy PHP versions.