Repository navigation
Conversation
Keep PHP >=8.1 and Symfony ^6.1 || ^7.0 compatibility while adding Symfony ^8.0 support, migrating DZunkeFeatureFlagsExtension to Symfony\Component\DependencyInjection\Extension\Extension, modernizing DebugFlagsCommand with #[AsCommand] and Command::SUCCESS, fixing the PHP 8.4 float-to-int deprecation in Percentage, fixing PercentageTest to use InputBag, and bumping phpunit/phpunit to ^9.6.21.
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.
Problem / Why
Add support for PHP 8.4 and Symfony 8 (
^8.0) while keeping full backwards compatibility with PHP>=8.1and Symfony^6.1 || ^7.0.What changed
composer.json): Added|| ^8.0to all 7symfony/*dependencies (^6.1 || ^7.0 || ^8.0) and bumpedphpunit/phpunitto^9.6.21(first PHPUnit 9 release compatible with PHP 8.4).DZunkeFeatureFlagsExtensionfrom the internal/deprecatedSymfony\Component\HttpKernel\DependencyInjection\ExtensiontoSymfony\Component\DependencyInjection\Extension\Extension.DebugFlagsCommandto use the#[AsCommand]attribute and returnCommand::SUCCESS.100 * (mt_rand(...) / mt_getrandmax())withrandom_int(0, 99)inPercentage::generateRandomNumber()to eliminate the PHP 8.1–8.4 float-to-int implicit conversion deprecation, and explicitly cast the cookie value to(string)insetcookie().PercentageTestto useSymfony\Component\HttpFoundation\InputBag(matchingRequest::$cookies's typedInputBagproperty) and isolated the unset-cookie test with@runInSeparateProcessand@preserveGlobalState disabled.Verification
Verified locally in Docker (
php:8.4-cli, PHP 8.4.28):php -lacross all.phpfiles:0syntax errors../vendor/bin/phpunit -von Symfony^8.0(highest&lowest),^7.0(highest), and^6.1(highest&lowest):OK (40 tests, 77 assertions)in all configurations.DZunkeFeatureFlagsBundle, compiling the DI container, evaluating a flag, and inspectingDebugFlagsCommand: passed on Symfony8.1.11,7.4.23, and6.4.50.