Class Kitab\Compiler\IntermediateRepresentation\Interface_

class Interface_ extends Kitab\Compiler\IntermediateRepresentation\Entity
{
    pub fn __construct(string $name);
    pub fn 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

pub const TYPE = 'interface';

Type of the entity. See parent.

Attributes

pub $parents = [];

Collection of fully-qualified names of the interfaces it extends if any.

pub $methods = [];

Collection of Kitab\Compiler\IntermediateRepresentation\Method instances.

Methods

pub fn __construct(string $name)

Allocate an interface with a fully-qualified name. This is the only mandatory information.

pub fn getMethods(): array

Return all methods declared for this entity.

Interfaces

interface Kitab\Compiler\IntermediateRepresentation\HasMethods