Copied!
CloneableInstantiable
Methods
public __construct(string $name)
 

Creates a class builder.

  • param string $name Name of the class
public addAttribute( $attribute)
 

Adds an attribute group.

  • param \Node\Attribute|\Node\AttributeGroup $attribute
  • return $this The builder instance (for fluid interface)
public addStmt( $stmt)
 

Adds a statement.

  • param \Stmt|\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 extend( $class)
 

Extends a class.

  • param \Name|string $class Name of class to extend
  • return $this The builder instance (for fluid interface)
public getNode() : PhpParser\Node
 

Returns the built class node.

  • return \Stmt\Class_ The built class node
public implement( $interfaces)
 

Implements one or more interfaces.

  • param \Name|string $interfaces Names of interfaces to implement
  • return $this The builder instance (for fluid interface)
public makeAbstract()
 

Makes the class abstract.

  • return $this The builder instance (for fluid interface)
public makeFinal()
 

Makes the class final.

  • return $this The builder instance (for fluid interface)
public makeReadonly()
 

Makes the class readonly.

  • return $this The builder instance (for fluid interface)
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 $attributeGroups = []
 
  • var list<\Node\AttributeGroup>
protected array PhpParser\Builder\Declaration::$attributes = []
 
  • var array<string,mixed>
protected array $constants = []
 
  • var list<\Stmt\ClassConst>
protected ?PhpParser\Node\Name $extends = NULL
protected int $flags = 0
protected array $implements = []
 
  • var list<\Name>
protected array $methods = []
 
  • var list<\Stmt\ClassMethod>
protected string $name
protected array $properties = []
 
  • var list<\Stmt\Property>
protected array $uses = []
 
  • var list<\Stmt\TraitUse>
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration