-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#3483Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | Rector 5db390cb7b67d3537acc34d3eabb04de1ef4b35a |
If a file has been cached with a different config/ruleset, it will still pass when the ruleset changes even though the file should not pass.
Minimal PHP Code Causing Issue
See https://getrector.com/demo/da1a6029-6842-4ddb-a7fd-1be936e2cc80
Using this example file:
<?php
final class DemoFile
{
public function run()
{
return array();
}
}and this config:
<?php
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_53,
]);
};- Run with the given config - ensure cache is created
- Change config to be
UP_TO_PHP_54 - Re-run
- Notice no files changed
- Re-run with
--cache-clear - Notice 1 files changed
Expected Behaviour
All cache should be invalidated upon config change.
PHPStan also invalidates cache on any config change and more https://phpstan.org/user-guide/result-cache
Reactions are currently unavailable