Documentation

Namespace_ extends Declaration
in package

Table of Contents

Properties

$attributes  : array<string, mixed>
$name  : Name|null
$stmts  : array<string|int, Stmt>

Methods

__construct()  : mixed
Creates a namespace builder.
addStmt()  : $this
Adds a statement.
addStmts()  : $this
Adds multiple statements.
getNode()  : Namespace_
Returns the built node.
setDocComment()  : $this
Sets doc comment for the declaration.

Properties

$attributes

protected array<string, mixed> $attributes = []

Methods

__construct()

Creates a namespace builder.

public __construct(Name|string|null $name) : mixed
Parameters
$name : Name|string|null

Name of the namespace

addStmt()

Adds a statement.

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

The statement to add

Return values
$this

The builder instance (for fluid interface)

addStmts()

Adds multiple statements.

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

The statements to add

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)


        
On this page

Search results