PHP Trait gossi\codegen\model\parts\InterfacesPart

For all models that can contain interfaces
Author: Thomas Gossmann
Datei anzeigen Open project: gossi/php-code-generator

Public Methods

Method Description
addInterface ( PhpInterface | string $interface ) Adds an interface.
addUseStatement ( string $qualifiedName, null | string $alias = null ) Adds a use statement with an optional alias
getInterfaces ( ) : phootwork\collection\Set Returns the interfaces
getNamespace ( ) : string Returns the namespace
hasInterface ( PhpInterface | string $interface ) : boolean Checks whether an interface exists
hasInterfaces ( ) : boolean Checks whether interfaces exists
removeInterface ( PhpInterface | string $interface ) Removes an interface.
removeUseStatement ( string $qualifiedName ) Removes a use statement
setInterfaces ( array $interfaces ) Sets a collection of interfaces

Private Methods

Method Description
initInterfaces ( )

Method Details

addInterface() public method

If the interface is passed as PhpInterface object, the interface is also added as use statement.
public addInterface ( PhpInterface | string $interface )
$interface gossi\codegen\model\PhpInterface | string interface or qualified name

addUseStatement() abstract public method

Adds a use statement with an optional alias
abstract public addUseStatement ( string $qualifiedName, null | string $alias = null )
$qualifiedName string
$alias null | string

getInterfaces() public method

Returns the interfaces
public getInterfaces ( ) : phootwork\collection\Set
return phootwork\collection\Set

getNamespace() abstract public method

Returns the namespace
abstract public getNamespace ( ) : string
return string

hasInterface() public method

Checks whether an interface exists
public hasInterface ( PhpInterface | string $interface ) : boolean
$interface gossi\codegen\model\PhpInterface | string interface name or instance
return boolean

hasInterfaces() public method

Checks whether interfaces exists
public hasInterfaces ( ) : boolean
return boolean `true` if interfaces are available and `false` if not

removeInterface() public method

If the interface is passed as PhpInterface object, the interface is also remove from the use statements.
public removeInterface ( PhpInterface | string $interface )
$interface gossi\codegen\model\PhpInterface | string interface or qualified name

removeUseStatement() abstract public method

Removes a use statement
abstract public removeUseStatement ( string $qualifiedName )
$qualifiedName string

setInterfaces() public method

Sets a collection of interfaces
public setInterfaces ( array $interfaces )
$interfaces array