PHP

PHP

Made by DeepSource

Abstract method found outside of an abstract class PHP-W1030

Bug risk
Critical

This issue is raised when abstract methods are found outside of an abstract class. This would result in a fatal runtime error.

To fix this, either implement the abstract methods or put them in an abstract class.

Bad practice

class AbstractRule
{
    abstract public function run(): void;
}

Recommended

Make the class abstract:

abstract class AbstractRule
{
    abstract public function run(): void;
}

Or, remove the abstract modifier from the method:

class AbstractRule
{
    public function run(): void;
}

References