MIR0228
NotAnInterface
A type that is expected to be an interface is actually a class or another type. This commonly occurs when using interfaces for dependency injection or type hints where only interfaces should be used.
Example
Section titled “Example”<?phpclass Service {}
// Error: Service is a class, not an interfaceinterface Repository extends Service { function find(int $id);}How to fix
Section titled “How to fix”Ensure the type is actually an interface:
<?phpinterface ServiceInterface { function execute();}
interface Repository extends ServiceInterface { function find(int $id);}