TraitUseAdaptation
in package
implements
Builder
Table of Contents
Interfaces
Constants
- TYPE_ALIAS = 1
- TYPE_PRECEDENCE = 2
- TYPE_UNDEFINED = 0
Properties
- $alias : Identifier|null
- $insteadof : array<string|int, Name>
- $method : Identifier
- $modifier : int|null
- $trait : Name|null
- $type : int
Methods
- __construct() : mixed
- Creates a trait use adaptation builder.
- as() : $this
- Sets alias of method.
- getNode() : Node
- Returns the built node.
- insteadof() : $this
- Adds overwritten traits.
- makePrivate() : $this
- Sets adapted method private.
- makeProtected() : $this
- Sets adapted method protected.
- makePublic() : $this
- Sets adapted method public.
- setModifier() : void
Constants
TYPE_ALIAS
private
mixed
TYPE_ALIAS
= 1
TYPE_PRECEDENCE
private
mixed
TYPE_PRECEDENCE
= 2
TYPE_UNDEFINED
private
mixed
TYPE_UNDEFINED
= 0
Properties
$alias
protected
Identifier|null
$alias
= null
$insteadof
protected
array<string|int, Name>
$insteadof
= []
$method
protected
Identifier
$method
$modifier
protected
int|null
$modifier
= null
$trait
protected
Name|null
$trait
$type
protected
int
$type
Methods
__construct()
Creates a trait use adaptation builder.
public
__construct(Name|string|null $trait, Identifier|string $method) : mixed
Parameters
- $trait : Name|string|null
-
Name of adapted trait
- $method : Identifier|string
-
Name of adapted method
as()
Sets alias of method.
public
as(Identifier|string $alias) : $this
Parameters
- $alias : Identifier|string
-
Alias for adapted method
Return values
$this —The builder instance (for fluid interface)
getNode()
Returns the built node.
public
getNode() : Node
Return values
Node —The built node
insteadof()
Adds overwritten traits.
public
insteadof(Name|string ...$traits) : $this
Parameters
- $traits : Name|string
-
Traits for overwrite
Return values
$this —The builder instance (for fluid interface)
makePrivate()
Sets adapted method private.
public
makePrivate() : $this
Return values
$this —The builder instance (for fluid interface)
makeProtected()
Sets adapted method protected.
public
makeProtected() : $this
Return values
$this —The builder instance (for fluid interface)
makePublic()
Sets adapted method public.
public
makePublic() : $this
Return values
$this —The builder instance (for fluid interface)
setModifier()
protected
setModifier(int $modifier) : void
Parameters
- $modifier : int