Param
in package
implements
Builder
Table of Contents
Interfaces
Properties
- $attributeGroups : array<int, AttributeGroup>
- $byRef : bool
- $default : Expr|null
- $flags : int
- $name : string
- $type : Identifier|Name|ComplexType|null
- $variadic : bool
Methods
- __construct() : mixed
- Creates a parameter builder.
- addAttribute() : $this
- Adds an attribute group.
- getNode() : Param
- Returns the built parameter node.
- makeByRef() : $this
- Make the parameter accept the value by reference.
- makePrivate() : $this
- Makes the (promoted) parameter private.
- makePrivateSet() : $this
- Gives the promoted property private(set) visibility.
- makeProtected() : $this
- Makes the (promoted) parameter protected.
- makeProtectedSet() : $this
- Gives the promoted property protected(set) visibility.
- makePublic() : $this
- Makes the (promoted) parameter public.
- makeReadonly() : $this
- Makes the (promoted) parameter readonly.
- makeVariadic() : $this
- Make the parameter variadic
- setDefault() : $this
- Sets default value for the parameter.
- setType() : $this
- Sets type for the parameter.
Properties
$attributeGroups
protected
array<int, AttributeGroup>
$attributeGroups
= []
$byRef
protected
bool
$byRef
= false
$default
protected
Expr|null
$default
= null
$flags
protected
int
$flags
= 0
$name
protected
string
$name
$type
protected
Identifier|Name|ComplexType|null
$type
= null
$variadic
protected
bool
$variadic
= false
Methods
__construct()
Creates a parameter builder.
public
__construct(string $name) : mixed
Parameters
- $name : string
-
Name of the parameter
addAttribute()
Adds an attribute group.
public
addAttribute(Attribute|AttributeGroup $attribute) : $this
Parameters
- $attribute : Attribute|AttributeGroup
Return values
$this —The builder instance (for fluid interface)
getNode()
Returns the built parameter node.
public
getNode() : Param
Return values
Param —The built parameter node
makeByRef()
Make the parameter accept the value by reference.
public
makeByRef() : $this
Return values
$this —The builder instance (for fluid interface)
makePrivate()
Makes the (promoted) parameter private.
public
makePrivate() : $this
Return values
$this —The builder instance (for fluid interface)
makePrivateSet()
Gives the promoted property private(set) visibility.
public
makePrivateSet() : $this
Return values
$this —The builder instance (for fluid interface)
makeProtected()
Makes the (promoted) parameter protected.
public
makeProtected() : $this
Return values
$this —The builder instance (for fluid interface)
makeProtectedSet()
Gives the promoted property protected(set) visibility.
public
makeProtectedSet() : $this
Return values
$this —The builder instance (for fluid interface)
makePublic()
Makes the (promoted) parameter public.
public
makePublic() : $this
Return values
$this —The builder instance (for fluid interface)
makeReadonly()
Makes the (promoted) parameter readonly.
public
makeReadonly() : $this
Return values
$this —The builder instance (for fluid interface)
makeVariadic()
Make the parameter variadic
public
makeVariadic() : $this
Return values
$this —The builder instance (for fluid interface)
setDefault()
Sets default value for the parameter.
public
setDefault(mixed $value) : $this
Parameters
- $value : mixed
-
Default value to use
Return values
$this —The builder instance (for fluid interface)
setType()
Sets type for the parameter.
public
setType(string|Name|Identifier|ComplexType $type) : $this
Parameters
- $type : string|Name|Identifier|ComplexType
-
Parameter type
Return values
$this —The builder instance (for fluid interface)