Documentation

Enum_ extends Declaration
in package

Table of Contents

$attributeGroups  : array<string|int, AttributeGroup>
$attributes  : mixed
$constants  : mixed
$enumCases  : mixed
$implements  : mixed
$methods  : mixed
$name  : mixed
$scalarType  : mixed
$uses  : mixed
__construct()  : mixed
Creates an enum builder.
addAttribute()  : $this
Adds an attribute group.
addStmt()  : $this
Adds a statement.
addStmts()  : $this
Adds multiple statements.
getNode()  : Enum_
Returns the built class node.
implement()  : $this
Implements one or more interfaces.
setDocComment()  : $this
Sets doc comment for the declaration.
setScalarType()  : $this
Sets the scalar type.

Properties

$constants

protected mixed $constants = []

$enumCases

protected mixed $enumCases = []

$implements

protected mixed $implements = []

$methods

protected mixed $methods = []

$scalarType

protected mixed $scalarType = null

$uses

protected mixed $uses = []

Methods

__construct()

Creates an enum builder.

public __construct(string $name) : mixed
Parameters
$name : string

Name of the enum

Return values
mixed

addStmt()

Adds a statement.

public addStmt(Stmt|Builder $stmt) : $this
Parameters
$stmt : Stmt|Builder

The statement to add

Return values
$this

The builder instance (for fluid interface)

addStmts()

Adds multiple statements.

public addStmts(array<string|int, mixed> $stmts) : $this
Parameters
$stmts : array<string|int, mixed>

The statements to add

Return values
$this

The builder instance (for fluid interface)

getNode()

Returns the built class node.

public getNode() : Enum_
Return values
Enum_

The built enum node

implement()

Implements one or more interfaces.

public implement(Name|string ...$interfaces) : $this
Parameters
$interfaces : Name|string

Names of interfaces to implement

Return values
$this

The builder instance (for fluid interface)

setDocComment()

Sets doc comment for the declaration.

public setDocComment(Doc|string $docComment) : $this
Parameters
$docComment : Doc|string

Doc comment to set

Return values
$this

The builder instance (for fluid interface)

setScalarType()

Sets the scalar type.

public setScalarType(mixed $scalarType) : $this
Parameters
$scalarType : mixed
Return values
$this

Search results