TraitUseAdaptation
in package
implements
Builder
Interfaces, Classes, Traits and Enums
Table of Contents
- TYPE_ALIAS = 1
- TYPE_PRECEDENCE = 2
- TYPE_UNDEFINED = 0
- $alias : mixed
- $insteadof : mixed
- $method : mixed
- $modifier : mixed
- $trait : mixed
- $type : int
- __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 adaptated method private.
- makeProtected() : $this
- Sets adaptated method protected.
- makePublic() : $this
- Sets adaptated method public.
- setModifier() : mixed
Constants
TYPE_ALIAS
public
mixed
TYPE_ALIAS
= 1
TYPE_PRECEDENCE
public
mixed
TYPE_PRECEDENCE
= 2
TYPE_UNDEFINED
public
mixed
TYPE_UNDEFINED
= 0
Properties
$alias
protected
mixed
$alias
= null
$insteadof
protected
mixed
$insteadof
= []
$method
protected
mixed
$method
$modifier
protected
mixed
$modifier
= null
$trait
protected
mixed
$trait
$type
protected
int
$type
Type of building adaptation
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 adaptated trait
- $method : Identifier|string
-
Name of adaptated method
Return values
mixed —as()
Sets alias of method.
public
as(Identifier|string $alias) : $this
Parameters
- $alias : Identifier|string
-
Alias for adaptated 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 adaptated method private.
public
makePrivate() : $this
Return values
$this —The builder instance (for fluid interface)
makeProtected()
Sets adaptated method protected.
public
makeProtected() : $this
Return values
$this —The builder instance (for fluid interface)
makePublic()
Sets adaptated method public.
public
makePublic() : $this
Return values
$this —The builder instance (for fluid interface)
setModifier()
protected
setModifier(int $modifier) : mixed
Parameters
- $modifier : int