Class Kitab\Compiler\IntermediateRepresentation\Interface_
class Interface_ extends Kitab\Compiler\IntermediateRepresentation\Entity
{
public function __construct(string $name);
public function getMethods(): array;
}
An interface intermediate representation.
An interface is one of the major entity in PHP. It exposes methods. An interface can inherit from other interfaces.
Examples
In this example, a new interface I
is built, with 1 method: f
.
$interface = new Kitab\Compiler\IntermediateRepresentation\Interface_('I');
$interface->methods[] = new Kitab\Compiler\IntermediateRepresentation\Method('f');
Constants
public const TYPE = 'interface';
-
Type of the entity. See parent.
Attributes
public $parents = [];
-
Collection of fully-qualified names of the interfaces it extends if any.
public $methods = [];
-
Collection of
Kitab\Compiler\IntermediateRepresentation\Method
instances.
Methods
-
public function __construct(string $name)
-
Allocate an interface with a fully-qualified name. This is the only mandatory information.
-
public function getMethods(): array
-
Return all methods declared for this entity.
Interfaces
interface Kitab\Compiler\IntermediateRepresentation\HasMethods
- …