Skip to content

MIR0704

InvalidExtendClass

A class extends a class declared as final or annotated with @final in its docblock.

This issue was previously named FinalClassExtended (same code MIR0704).

<?php
final class Singleton {}
class MyClass extends Singleton {} // cannot extend final class

@final docblock annotations are also respected:

<?php
/** @final */
class Base {}
class Child extends Base {} // cannot extend @final class

Remove the final keyword (or @final annotation) from the parent class, or do not extend it.