Documentation

Class_ extends Declaration
in package

Table of Contents

$attributeGroups  : array<string|int, AttributeGroup>
$attributes  : mixed
$constants  : mixed
$extends  : mixed
$flags  : mixed
$implements  : mixed
$methods  : mixed
$name  : mixed
$properties  : mixed
$uses  : mixed
__construct()  : mixed
Creates a class builder.
addAttribute()  : $this
Adds an attribute group.
addStmt()  : $this
Adds a statement.
addStmts()  : $this
Adds multiple statements.
extend()  : $this
Extends a class.
getNode()  : Class_
Returns the built class node.
implement()  : $this
Implements one or more interfaces.
makeAbstract()  : $this
Makes the class abstract.
makeFinal()  : $this
Makes the class final.
makeReadonly()  : mixed
setDocComment()  : $this
Sets doc comment for the declaration.

Properties

$constants

protected mixed $constants = []

$extends

protected mixed $extends = null

$flags

protected mixed $flags = 0

$implements

protected mixed $implements = []

$methods

protected mixed $methods = []

$properties

protected mixed $properties = []

$uses

protected mixed $uses = []

Methods

__construct()

Creates a class builder.

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

Name of the class

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)

extend()

Extends a class.

public extend(Name|string $class) : $this
Parameters
$class : Name|string

Name of class to extend

Return values
$this

The builder instance (for fluid interface)

getNode()

Returns the built class node.

public getNode() : Class_
Return values
Class_

The built class 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)

makeAbstract()

Makes the class abstract.

public makeAbstract() : $this
Return values
$this

The builder instance (for fluid interface)

makeFinal()

Makes the class final.

public makeFinal() : $this
Return values
$this

The builder instance (for fluid interface)

makeReadonly()

public makeReadonly() : mixed
Return values
mixed

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)

Search results