Repository navigation
Reimplement ReplaceArgumentDefaultValueRector usages as dedicated rules - #1079
Merged
Merged
Conversation
Replace the configurable core ReplaceArgumentDefaultValueRector, which may be deprecated, with standalone, self version-bonded Symfony rules: - UrlGeneratorReferenceTypeRector (symfony/routing >=2.8) - YamlFlagsToConstantRector (symfony/yaml >=3.1) - CookieSameSiteConstantRector (symfony/http-foundation >=4.2) - CookieConstructorDefaultsRector (symfony/http-foundation >=4.2)
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.
Replaces the configurable core
ReplaceArgumentDefaultValueRector(likely to be deprecated) with standalone, self version-bonded Symfony rules. Each rule declares its own composer package constraint viaComposerPackageConstraintInterfaceand carries its own matching logic, sorector-symfonyno longer depends on the coreRector\Argumentsnamespace for these transforms.New rules:
UrlGeneratorReferenceTypeRector-symfony/routing >=2.8;UrlGeneratorInterface::generate()reference type magic values to constantsYamlFlagsToConstantRector-symfony/yaml >=3.1;Yaml::parse()/Yaml::dump()boolean flag args to Yaml flag constants (incl. array collapse)CookieSameSiteConstantRector-symfony/http-foundation >=4.2;Cookie__construct/create/withSameSitesame-site strings toSAMESITE_*constantsCookieConstructorDefaultsRector-symfony/http-foundation >=4.2;Cookieconstructor 4.2 default changes ($securefalse to null,$sameSitenull to lax)The five
ruleWithConfigurationComposerVersionBound(ReplaceArgumentDefaultValueRector::class, ...)blocks incomposer-based.phpare removed and replaced by registering the dedicated rules.Note: the three same-site transforms were previously spread across
>=3.2,>=4.2and>=5.1; they are consolidated into one rule bonded at>=4.2, the lowest version where allSAMESITE_*constants exist.symfony/yamlandsymfony/http-foundationadded to require-dev so the bonded tests resolve deterministically.All added rules covered by tests; ECS, PHPStan, class-leak, duplicated-code and the full suite pass locally.