MIR0216
NonStaticSelfCall
self::method() is used to call an instance method from within the same class, but the target
method is not declared static. This is only valid inside a static context.
Example
Section titled “Example”<?phpclass MyClass { public function helper(): string { return 'help'; }
public static function run(): string { return self::helper(); // helper() is not static }}How to fix
Section titled “How to fix”Declare helper() as static, or call it on an instance instead:
<?phppublic static function run(): string { $instance = new self(); return $instance->helper();}