mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-29 22:23:30 +00:00
If a class could be inherited, "$this->"" needs to become "static::" instead of "self::"
This commit is contained in:
parent
34c40428f3
commit
c2da307e2d
|
@ -51,7 +51,7 @@ class SomeClass
|
||||||
{
|
{
|
||||||
public static function run()
|
public static function run()
|
||||||
{
|
{
|
||||||
self::eat();
|
static::eat();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function eat()
|
public static function eat()
|
||||||
|
@ -100,6 +100,6 @@ PHP
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->createStaticCall('self', $methodName, $node->args);
|
return $this->createStaticCall('static', $methodName, $node->args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class SomeClass
|
||||||
{
|
{
|
||||||
public static function run()
|
public static function run()
|
||||||
{
|
{
|
||||||
self::eat('something');
|
static::eat('something');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function eat(string $thing)
|
public static function eat(string $thing)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user