EnumCase
in package
implements
Builder
Table of Contents
Interfaces
Properties
- $attributeGroups : array<int, AttributeGroup>
- $attributes : array<string, mixed>
- $name : Identifier|string
- $value : Expr|null
Methods
- __construct() : mixed
- Creates an enum case builder.
- addAttribute() : $this
- Adds an attribute group.
- getNode() : EnumCase
- Returns the built enum case node.
- setDocComment() : $this
- Sets doc comment for the constant.
- setValue() : $this
- Sets the value.
Properties
$attributeGroups
protected
array<int, AttributeGroup>
$attributeGroups
= []
$attributes
protected
array<string, mixed>
$attributes
= []
$name
protected
Identifier|string
$name
$value
protected
Expr|null
$value
= null
Methods
__construct()
Creates an enum case builder.
public
__construct(string|Identifier $name) : mixed
Parameters
- $name : string|Identifier
-
Name
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 enum case node.
public
getNode() : EnumCase
Return values
EnumCase —The built constant node
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)
setValue()
Sets the value.
public
setValue(Expr|string|int $value) : $this
Parameters
- $value : Expr|string|int