Skip to content

Make deprecated withPhpCsFixerSets() accept legacy args without crashing - #155

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-deprecated-php-cs-fixer-sets-args
Oct 7, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-deprecated-php-cs-fixer-sets-args

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Fixes ecsphp/ecs#331

The deprecated withPhpCsFixerSets() took no parameters, so calling it with the former named arguments (e.g. ->withPhpCsFixerSets(perCS30: true)) threw an "unknown named parameter" error instead of printing the deprecation warning.

Added a bool ...$sets variadic so legacy calls are swallowed gracefully and the deprecation warning is shown as intended.

  • Added regression test covering a named-argument call
  • Skipped RemoveUnusedPublicMethodParameterRector on the builder, since the variadic intentionally exists only to absorb legacy args

@TomasVotruba
TomasVotruba merged commit 34deab4 into main Oct 7, 2026
19 checks passed
@TomasVotruba
TomasVotruba deleted the fix-deprecated-php-cs-fixer-sets-args branch October 7, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration from ECS 13.0 to 13.3 with unexpected error

1 participant