TraitUse
in package
implements
Builder
Table of Contents
Interfaces
Properties
- $adaptations : array<string|int, TraitUseAdaptation>
- $traits : array<string|int, Name>
Methods
- __construct() : mixed
- Creates a trait use builder.
- and() : $this
- Adds used trait.
- getNode() : Node
- Returns the built node.
- with() : $this
- Adds trait adaptation.
Properties
$adaptations
protected
array<string|int, TraitUseAdaptation>
$adaptations
= []
$traits
protected
array<string|int, Name>
$traits
= []
Methods
__construct()
Creates a trait use builder.
public
__construct(Name|string ...$traits) : mixed
Parameters
- $traits : Name|string
-
Names of used traits
and()
Adds used trait.
public
and(Name|string $trait) : $this
Parameters
- $trait : Name|string
-
Trait name
Return values
$this —The builder instance (for fluid interface)
getNode()
Returns the built node.
public
getNode() : Node
Return values
Node —The built node
with()
Adds trait adaptation.
public
with(TraitUseAdaptation|TraitUseAdaptation $adaptation) : $this
Parameters
- $adaptation : TraitUseAdaptation|TraitUseAdaptation
-
Trait adaptation
Return values
$this —The builder instance (for fluid interface)