If a class could be inherited, "$this->"" needs to become "static::" instead of "self::"

This commit is contained in:
Derrick Schoen 2020-06-19 09:09:46 -04:00
parent 34c40428f3
commit c2da307e2d
2 changed files with 3 additions and 3 deletions

View File

@ -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);
} }
} }

View File

@ -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)