trait InterfacesTrait

Methods

addUseStatement($qualifiedName, $alias = null)

No description

removeUseStatement($qualifiedName)

No description

getNamespace()

No description

$this
addInterface(PhpInterface|string $interface)

Adds an interface.

getInterfaces()

Returns the interfaces

boolean
hasInterfaces()

Checks whether interfaces exists

boolean
hasInterface(PhpInterface|string $interface)

Checks whether an interface exists

$this
removeInterface(PhpInterface|string $interface)

Removes an interface.

$this
setInterfaces(array $interfaces)

Sets a collection of interfaces

Details

at line line 10
abstract addUseStatement($qualifiedName, $alias = null)

Parameters

$qualifiedName
$alias

at line line 12
abstract removeUseStatement($qualifiedName)

Parameters

$qualifiedName

at line line 14
abstract getNamespace()

at line line 25
$this addInterface(PhpInterface|string $interface)

Adds an interface.

If the interface is passed as PhpInterface object, the interface is also added as use statement.

Parameters

PhpInterface|string $interface interface or qualified name

Return Value

$this

at line line 50
PhpInterface[] getInterfaces()

Returns the interfaces

Return Value

PhpInterface[]

at line line 59
boolean hasInterfaces()

Checks whether interfaces exists

Return Value

boolean true if interfaces are available and false if not

at line line 69
boolean hasInterface(PhpInterface|string $interface)

Checks whether an interface exists

Parameters

PhpInterface|string $interface interface name or instance

Return Value

boolean

at line line 86
$this removeInterface(PhpInterface|string $interface)

Removes an interface.

If the interface is passed as PhpInterface object, the interface is also remove from the use statements.

Parameters

PhpInterface|string $interface interface or qualified name

Return Value

$this

at line line 110
$this setInterfaces(array $interfaces)

Sets a collection of interfaces

Parameters

array $interfaces

Return Value

$this