[composer-based] Add composer-based command - #8246
Conversation
…led package version
|
I just updated to the latest version, ran |
|
Can you share PHPStan and PHP version? |
|
PHP: |
|
Thanks. Nothing rings a bell. |
|
Just tried with PHPStan |
|
How's the Rector and PHPStan installed? Composer, Docker, global, dev etc. |
|
Both via composer. |
|
Can you share min rector.php that is causing it? |
|
I cleared the cache — didn't help. I get the error with just this minimal config: return RectorConfig::configure()
->withComposerBased(symfony: true)
;I have Symfony |
|
When I remove return RectorConfig::configure()
->withComposerBased(twig: true, doctrine: true, phpunit: true)
;it works! |
|
I tried it locally and that's the issue. I'm looking into it 👍 |
|
PR in progress: #8280 |
|
Fixed and released: https://github.com/rectorphp/rector/releases/edit/2.6.1 Many new rules landed in the Symfony and Twig sets now. Let me know if you find any new issues 👍 |
Rules can bind themselves to an installed package version via
ComposerPackageConstraintInterface, andComposerPackageConstraintFiltersilently drops the ones that do not match. There was no way to see which rules those are, or why a rule did not run.New
composer-basedcommand:Run in rector-phpunit with
PHPUnitSetList::COMPOSER_BASEDloaded:Columns:
provideComposerPackageConstraint()-when the package is not installedComposerPackageConstraintFilterwill keep the ruleInactive rules are listed too, which is the point - a rule missing from the run is now visible with the reason next to it.
Covered by
ComposerBasedCommandTest- the empty case, an active rule, and a rule whose package is not installed.