Copied!
CloneableInstantiable
Methods
public __construct( $name)
 

Creates a namespace builder.

  • param \Node\Name|string|null $name Name of the namespace
public addStmt( $stmt)
 

Adds a statement.

  • param \Node|\PhpParser\Builder $stmt The statement to add
  • return $this The builder instance (for fluid interface)
public PhpParser\Builder\Declaration::addStmts(array $stmts)
 

Adds multiple statements.

  • param (\PhpParser\Node\Stmt|\PhpParser\Builder)[] $stmts The statements to add
  • return $this The builder instance (for fluid interface)
public getNode() : PhpParser\Node
 

Returns the built node.

  • return \Stmt\Namespace_ The built node
public PhpParser\Builder\Declaration::setDocComment( $docComment)
 

Sets doc comment for the declaration.

  • param \PhpParser\Comment\Doc|string $docComment Doc comment to set
  • return $this The builder instance (for fluid interface)
Properties
protected array PhpParser\Builder\Declaration::$attributes = []
 
  • var array<string,mixed>
Properties
private ?PhpParser\Node\Name $name
private array $stmts = []
 
  • var \Stmt[]
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration