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
= []
$name
private
Name|null
$name
$stmts
private
array<string|int, Stmt>
$stmts
= []
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
Return values
$this —The builder instance (for fluid interface)
addStmts()
Adds multiple statements.
public
addStmts(array<string|int, Stmt|Builder> $stmts) : $this
Parameters
Return values
$this —The builder instance (for fluid interface)
getNode()
Returns the built node.
public
getNode() : Namespace_
Return values
Namespace_ —The built node
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)