website/errors/class.missingExtends.md
<?php declare(strict_types = 1);
abstract class BaseController
{
}
/**
* @phpstan-require-extends BaseController
*/
interface ControllerInterface
{
}
class MyService implements ControllerInterface
{
}
An interface or trait declares a @phpstan-require-extends tag that requires any implementing class (or class using the trait) to extend a specific base class. The class does not extend the required class.
In the example above, ControllerInterface requires implementing classes to extend BaseController, but MyService does not extend BaseController.
Extend the required base class:
-class MyService implements ControllerInterface
+class MyService extends BaseController implements ControllerInterface
{
}