Skip to content

Deprecate ReplaceArgumentDefaultValueRector in favor of custom rule - #8686

Merged
TomasVotruba merged 3 commits into
mainfrom
tv-deprecate-replace-argument-default-value
Oct 17, 2026
Merged

TomasVotruba merged 3 commits into
mainfrom
tv-deprecate-replace-argument-default-value

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Deprecates ReplaceArgumentDefaultValueRector.

Its configuration is weak and messy - it relies on magic strings to reference constants (e.g. 'SomeClass::OLD_CONSTANT'), with no type safety and no IDE support. A dedicated custom Rector rule is a clearer and safer way to replace arguments.

  • marks the rule with DeprecatedInterface + @deprecated
  • refactor() now throws, body/config stripped
  • removes the rule test suite
  • drops the now-dangling phpstan ignore for the deleted test config

Note: the rule is @api used in rector-symfony, so a follow-up PR there is needed to drop its usage.

@TomasVotruba
TomasVotruba force-pushed the tv-deprecate-replace-argument-default-value branch from 3bd13dc to 4dc7f9d Compare October 17, 2026 18:23
@TomasVotruba
TomasVotruba merged commit 6253d93 into main Oct 17, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-deprecate-replace-argument-default-value branch October 17, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants