Menu

## ClassConst
in package
implements Builder

ClassConst.php : 14

### Interfaces, Classes and Traits

Builder

### 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

ClassConst.php : 21
`protected array<string|int, AttributeGroup> $attributeGroups = []`

#### $attributes

ClassConst.php : 17
`protected mixed $attributes = []`

#### $constants

ClassConst.php : 18
`protected mixed $constants = []`

#### $flags

ClassConst.php : 16
`protected mixed $flags = 0`

### Methods

#### __construct()

ClassConst.php : 29

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()

ClassConst.php : 113

Adds an attribute group.

`public addAttribute(Attribute|AttributeGroup $attribute) : $this`

##### Parameters

$attribute : Attribute|AttributeGroup

##### Return values

$this —

The builder instance (for fluid interface)

#### addConst()

ClassConst.php : 41

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()

ClassConst.php : 124

Returns the built class node.

`public getNode() : ClassConst`

##### Return values

ClassConst —

The built constant node

#### makeFinal()

ClassConst.php : 85

Makes the constant final.

`public makeFinal() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makePrivate()

ClassConst.php : 74

Makes the constant private.

`public makePrivate() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makeProtected()

ClassConst.php : 63

Makes the constant protected.

`public makeProtected() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makePublic()

ClassConst.php : 52

Makes the constant public.

`public makePublic() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### setDocComment()

ClassConst.php : 98

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)

## Search results