Repository navigation
Deprecate FunctionArgumentDefaultValueReplacerRector in favor of dedicated rules - #8692
Merged
TomasVotruba merged 1 commit intoOct 17, 2026
Conversation
…cated rules Replace the generic configured usage in php80 and php-version-based sets with two explicit rules: VersionCompareFuncCallArgumentRector and GetHeadersArgumentFormatRector.
TomasVotruba
deleted the
tv-deprecate-function-argument-default-value-replacer
branch
October 17, 2026 19:23
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.
Follows up on the
ReplaceArgumentDefaultValueRectordeprecation (#8686) and extends the same idea to the function-call variant.FunctionArgumentDefaultValueReplacerRectorrelies on weak, magic-value configuration. Inside rector-src it was only ever configured for two concrete PHP 8.0 cases, so those are replaced with explicit, type-safe rules:VersionCompareFuncCallArgumentRector- normalizes theversion_compare()operator aliases (gte->ge,lte->le,''/!->!=,g->gt,l->lt,n->ne).GetHeadersArgumentFormatRector- turns the integer associative argument ofget_headers()into a boolean (0->false,1->true).Both are registered in
php80andphp-version-basedsets in place of the generic configured rule, and gate themselves viaMinPhpVersionInterface(PHP 8.0).The generic
FunctionArgumentDefaultValueReplacerRectoris deprecated the same way as #8686: it now implementsDeprecatedInterfaceand throws, pointing users to a dedicated custom rule. Its old test fixtures are removed; theReplaceFuncCallArgumentDefaultValuevalue object andArgumentDefaultValueReplacerare kept and marked@apifor backward compatibility.