ClassConst
in package
implements
Builder
Interfaces, Classes, Traits and Enums
Table of Contents
- $attributeGroups : array<string|int, AttributeGroup>
- $attributes : mixed
- $constants : mixed
- $flags : mixed
- __construct() : mixed
- Creates a class constant builder
- addAttribute() : $this
- Adds an attribute group.
- addConst() : $this
- Add another constant to const group
- getNode() : ClassConst
- Returns the built class node.
- makeFinal() : $this
- Makes the constant final.
- makePrivate() : $this
- Makes the constant private.
- makeProtected() : $this
- Makes the constant protected.
- makePublic() : $this
- Makes the constant public.
- setDocComment() : $this
- Sets doc comment for the constant.
Properties
$attributeGroups
protected
array<string|int, AttributeGroup>
$attributeGroups
= []
$attributes
protected
mixed
$attributes
= []
$constants
protected
mixed
$constants
= []
$flags
protected
mixed
$flags
= 0
Methods
__construct()
Creates a class constant builder
public
__construct(string|Identifier $name, Expr|bool|null|int|float|string|array<string|int, mixed> $value) : mixed
Parameters
- $name : string|Identifier
-
Name
- $value : Expr|bool|null|int|float|string|array<string|int, mixed>
-
Value
Return values
mixed —addAttribute()
Adds an attribute group.
public
addAttribute(Attribute|AttributeGroup $attribute) : $this
Parameters
- $attribute : Attribute|AttributeGroup
Return values
$this —The builder instance (for fluid interface)
addConst()
Add another constant to const group
public
addConst(string|Identifier $name, Expr|bool|null|int|float|string|array<string|int, mixed> $value) : $this
Parameters
- $name : string|Identifier
-
Name
- $value : Expr|bool|null|int|float|string|array<string|int, mixed>
-
Value
Return values
$this —The builder instance (for fluid interface)
getNode()
Returns the built class node.
public
getNode() : ClassConst
Return values
ClassConst —The built constant node
makeFinal()
Makes the constant final.
public
makeFinal() : $this
Return values
$this —The builder instance (for fluid interface)
makePrivate()
Makes the constant private.
public
makePrivate() : $this
Return values
$this —The builder instance (for fluid interface)
makeProtected()
Makes the constant protected.
public
makeProtected() : $this
Return values
$this —The builder instance (for fluid interface)
makePublic()
Makes the constant public.
public
makePublic() : $this
Return values
$this —The builder instance (for fluid interface)
setDocComment()
Sets doc comment for the constant.
public
setDocComment(Doc|string $docComment) : $this
Parameters
- $docComment : Doc|string
-
Doc comment to set
Return values
$this —The builder instance (for fluid interface)