diff --git a/rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php b/rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php index b3cb7e90..39362d51 100644 --- a/rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php +++ b/rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php @@ -54,6 +54,9 @@ public function refactor(Node $node): ?Ternary static $currentFile = null; if ($currentFile !== $this->file->getFilePath()) { + // the counter need start from 0 when visit new file to avoid random increment + // across files + // due to run on parallel $this->counter = 0; $currentFile = $this->file->getFilePath(); }