Interface %s cannot extend class %s

Description

An interface must extends another interface. It cannot extends a class, nor a trait, nor an enum.

Also, a class cannot extends an interface: it must implement it.

Example

<?php

class X {}

interface I extends X {}

?>

Literal Examples

  • Interface I cannot extend class C

Solutions

  • Turn the original class into an interface.

  • Make the original interface into an class.

  • Split the class into a class and an interface, and extends the latter.