InterfacesPart
trait InterfacesPart
Interfaces part
For all models that can contain interfaces
Methods
$this
addUseStatement(string $qualifiedName, null|string $alias = null)
Adds a use statement with an optional alias
$this
removeUseStatement(string $qualifiedName)
Removes a use statement
string
getNamespace()
Returns the namespace
$this
Set
getInterfaces()
Returns the interfaces
bool
hasInterfaces()
Checks whether interfaces exists
bool
$this
$this
setInterfaces(array $interfaces)
Sets a collection of interfaces
Details
at line line 30
abstract $this
addUseStatement(string $qualifiedName, null|string $alias = null)
Adds a use statement with an optional alias
at line line 38
abstract $this
removeUseStatement(string $qualifiedName)
Removes a use statement
at line line 45
abstract string
getNamespace()
Returns the namespace
at line line 56
$this
addInterface(PhpInterface|string $interface)
Adds an interface.
If the interface is passed as PhpInterface object, the interface is also added as use statement.
at line line 79
Set
getInterfaces()
Returns the interfaces
at line line 88
bool
hasInterfaces()
Checks whether interfaces exists
at line line 98
bool
hasInterface(PhpInterface|string $interface)
Checks whether an interface exists
at line line 116
$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.
at line line 137
$this
setInterfaces(array $interfaces)
Sets a collection of interfaces