Change static::*
to self::*
on final class or private static members
final class SomeClass
{
public function run()
{
- static::CONSTANT;
- static::$property;
- static::method();
+ self::CONSTANT;
+ self::$property;
+ self::method();
}
}
Configure your rector.php
:
<?php
use Rector\CodeQuality\Rector\Class_\ConvertStaticToSelfRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
ConvertStaticToSelfRector::class,
]);