-
-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dx] log rules registered in both withRules() and sets, keep them once to avoid duplications or invalid use #6761
Conversation
7c13d2e
to
d6d0351
Compare
By this, this config will no longer working: <?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
return RectorConfig::configure()
// A. whole set
->withPreparedSets(typeDeclarations: true)
// B. or few rules
->withRules([
TypedPropertyFromAssignsRector::class
]); for default demo page config https://getrector.com/demo However, when <?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
return RectorConfig::configure()
// A. whole set
->withPreparedSets(typeDeclarations: true)
// B. OVERRIDE RULE
->withConfiguredRule(TypedPropertyFromAssignsRector::class, [
'inline_public' => true,
]); this also needs test for configurable rule registered multiple times to keep working, eg: multiple config included with configurable rules. |
The first example is mutually exclusive. Either use A, or B. Not together. For second use case, I think the configured rules are now skipped, as |
No..., withRules() accept configurable rule with default config, so when collect rules, |
…e to avoid duplications or invalid use
d6d0351
to
03088fa
Compare
f68c17d
to
ff6ad47
Compare
I've just tagged a new Rector release https://github.com/rectorphp/rector-src/releases/tag/2.0.10, Let's ship it :) |
No description provided.