Pattern: Use of $this
in static method
Issue: -
Checks for usage of $this
in static methods, which will cause runtime errors.
Example of incorrect code:
class SomeClass
{
static function test()
{
return $this->$staticMember;
}
}
Example of correct code:
class SomeClass
{
static function test()
{
return self::$staticMember;
}
}