Copied!
CloneableInstantiable
Methods
public args(array $args) : array
 

Normalizes an argument list.

Creates Arg nodes for all arguments and converts literal values to expressions.

  • param array $args List of arguments to normalize
  • return list<\Arg>
public attribute( $name, array $args = []) : PhpParser\Node\Attribute
 

Creates an attribute node.

  • param string|\Name $name Name of the attribute
  • param array $args Attribute named arguments
public class(string $name) : PhpParser\Builder\Class_
 

Creates a class builder.

  • param string $name Name of the class
  • return \Builder\Class_ The created class builder
public classConst( $name, $value) : PhpParser\Builder\ClassConst
 

Creates a class constant builder.

  • param string|\Identifier $name Name
  • param \Node\Expr|bool|null|int|float|string|array $value Value
  • return \Builder\ClassConst The created use const builder
public classConstFetch( $class, $name) : PhpParser\Node\Expr\ClassConstFetch
 

Creates a class constant fetch node.

  • param string|\Name|\Expr $class Class name
  • param string|\Identifier|\Expr $name Constant name
public concat( $exprs) : PhpParser\Node\Expr\BinaryOp\Concat
 

Creates nested Concat nodes from a list of expressions.

  • param \Expr|string $exprs Expressions or literal strings
public constFetch( $name) : PhpParser\Node\Expr\ConstFetch
 

Creates a constant fetch node.

  • param string|\Name $name Constant name
public enum(string $name) : PhpParser\Builder\Enum_
 

Creates an enum builder.

  • param string $name Name of the enum
  • return \Builder\Enum_ The created enum builder
public enumCase( $name) : PhpParser\Builder\EnumCase
 

Creates an enum case builder.

  • param string|\Identifier $name Name
  • return \Builder\EnumCase The created use const builder
public funcCall( $name, array $args = []) : PhpParser\Node\Expr\FuncCall
 

Creates a function call node.

  • param string|\Name|\Expr $name Function name
  • param array $args Function arguments
public function(string $name) : PhpParser\Builder\Function_
 

Creates a function builder.

  • param string $name Name of the function
  • return \Builder\Function_ The created function builder
public interface(string $name) : PhpParser\Builder\Interface_
 

Creates an interface builder.

  • param string $name Name of the interface
  • return \Builder\Interface_ The created interface builder
public method(string $name) : PhpParser\Builder\Method
 

Creates a method builder.

  • param string $name Name of the method
  • return \Builder\Method The created method builder
public methodCall(PhpParser\Node\Expr $var, $name, array $args = []) : PhpParser\Node\Expr\MethodCall
 

Creates a method call node.

  • param \Expr $var Variable the method is called on
  • param string|\Identifier|\Expr $name Method name
  • param array $args Method arguments
public namespace( $name) : PhpParser\Builder\Namespace_
 

Creates a namespace builder.

  • param null|string|\Node\Name $name Name of the namespace
  • return \Builder\Namespace_ The created namespace builder
public new( $class, array $args = []) : PhpParser\Node\Expr\New_
 

Creates an object creation node.

  • param string|\Name|\Expr $class Class name
  • param array $args Constructor arguments
public param(string $name) : PhpParser\Builder\Param
 

Creates a parameter builder.

  • param string $name Name of the parameter
  • return \Builder\Param The created parameter builder
public property(string $name) : PhpParser\Builder\Property
 

Creates a property builder.

  • param string $name Name of the property
  • return \Builder\Property The created property builder
public propertyFetch(PhpParser\Node\Expr $var, $name) : PhpParser\Node\Expr\PropertyFetch
 

Creates a property fetch node.

  • param \Expr $var Variable holding object
  • param string|\Identifier|\Expr $name Property name
public staticCall( $class, $name, array $args = []) : PhpParser\Node\Expr\StaticCall
 

Creates a static method call node.

  • param string|\Name|\Expr $class Class name
  • param string|\Identifier|\Expr $name Method name
  • param array $args Method arguments
public trait(string $name) : PhpParser\Builder\Trait_
 

Creates a trait builder.

  • param string $name Name of the trait
  • return \Builder\Trait_ The created trait builder
public traitUseAdaptation( $trait, $method = NULL) : PhpParser\Builder\TraitUseAdaptation
 

Creates a trait use adaptation builder.

  • param \Node\Name|string|null $trait Trait name
  • param \Node\Identifier|string $method Method name
  • return \Builder\TraitUseAdaptation The created trait use adaptation builder
public use( $name) : PhpParser\Builder\Use_
 

Creates a namespace/class use builder.

  • param \Node\Name|string $name Name of the entity (namespace or class) to alias
  • return \Builder\Use_ The created use builder
public useConst( $name) : PhpParser\Builder\Use_
 

Creates a constant use builder.

  • param \Node\Name|string $name Name of the const to alias
  • return \Builder\Use_ The created use const builder
public useFunction( $name) : PhpParser\Builder\Use_
 

Creates a function use builder.

  • param \Node\Name|string $name Name of the function to alias
  • return \Builder\Use_ The created use function builder
public useTrait( $traits) : PhpParser\Builder\TraitUse
 

Creates a trait use builder.

  • param \Node\Name|string $traits Trait names
  • return \Builder\TraitUse The created trait use builder
public val( $value) : PhpParser\Node\Expr
 

Creates node a for a literal value.

  • param \Expr|bool|null|int|float|string|array $value $value
public var( $name) : PhpParser\Node\Expr\Variable
 

Creates variable node.

  • param string|\Expr $name Name
Methods
private normalizeStringExpr( $expr) : PhpParser\Node\Expr
 
  • param string|\Expr $expr
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration