Psr2 Code Generator

InterfacesPart

Interfaces part.

For all models that can contain interfaces

Tags
author

Thomas Gossmann

Table of Contents

$interfaces  : Set
addInterface()  : $this
Adds an interface.
getInterfaces()  : Set
Returns the interfaces.
hasInterface()  : bool
Checks whether an interface exists.
hasInterfaceByName()  : bool
Checks whether an interface exists.
hasInterfaces()  : bool
Checks whether interfaces exists.
removeInterface()  : $this
Removes an interface.
removeInterfaceByName()  : $this
Removes an interface.
setInterfaces()  : $this
Sets a collection of interfaces.
initInterfaces()  : void

Properties

Methods

addInterface()

Adds an interface.

public addInterface(PhpInterface|string $interface) : $this

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

Parameters
$interface : PhpInterface|string

interface or qualified name

Return values
$this

getInterfaces()

Returns the interfaces.

public getInterfaces() : Set
Return values
Set

hasInterfaceByName()

Checks whether an interface exists.

public hasInterfaceByName(string $name) : bool
Parameters
$name : string

interface name

Return values
bool

hasInterfaces()

Checks whether interfaces exists.

public hasInterfaces() : bool
Return values
bool

true if interfaces are available and false if not

removeInterface()

Removes an interface.

public removeInterface(PhpInterface $interface) : $this

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

Parameters
$interface : PhpInterface

interface or qualified name

Return values
$this

removeInterfaceByName()

Removes an interface.

public removeInterfaceByName(string $name) : $this

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

Parameters
$name : string

interface qualified name

Return values
$this

setInterfaces()

Sets a collection of interfaces.

public setInterfaces(array<string|int, PhpInterface$interfaces) : $this
Parameters
$interfaces : array<string|int, PhpInterface>
Return values
$this

initInterfaces()

private initInterfaces() : void
Return values
void

Search results