TraitsTrait
trait TraitsTrait
Methods
addUseStatement($qualifiedName, $alias = null)
No description
removeUseStatement($qualifiedName)
No description
getNamespace()
No description
string[]
getTraits()
Returns a collection of traits
$this
$this
setTraits(array $traits)
Sets a collection of traits
Details
at line line 10
abstract
addUseStatement($qualifiedName, $alias = null)
at line line 12
abstract
removeUseStatement($qualifiedName)
at line line 14
abstract
getNamespace()
at line line 25
$this
addTrait(PhpTrait|string $trait)
Adds a trait.
If the trait is passed as PhpTrait object, the trait is also added as use statement.
at line line 50
string[]
getTraits()
Returns a collection of traits
at line line 60
boolean
hasTrait(PhpTrait|string $trait)
Checks whether a trait exists
at line line 77
$this
removeTrait(PhpTrait|string $trait)
Removes a trait.
If the trait is passed as PhpTrait object, the trait is also removed from use statements.
at line line 103
$this
setTraits(array $traits)
Sets a collection of traits