Change variable class constant fetch to direct class constant fetch
class SomeClass
{
public function run(AnotherClass $anotherClass)
{
- return $anotherClass::CONSTANT_NAME;
+ return AnotherClass::CONSTANT_NAME;
}
}
Configure your rector.php:
<?php
use Rector\CodeQuality\Rector\ClassConstFetch\VariableConstFetchToClassConstFetchRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
VariableConstFetchToClassConstFetchRector::class,
]);