BuilderFactory
in package
Table of Contents
Methods
- args() : array<int, Arg>
- Normalizes an argument list.
- attribute() : Attribute
- Creates an attribute node.
- class() : Class_
- Creates a class builder.
- classConst() : ClassConst
- Creates a class constant builder.
- classConstFetch() : ClassConstFetch
- Creates a class constant fetch node.
- concat() : Concat
- Creates nested Concat nodes from a list of expressions.
- constFetch() : ConstFetch
- Creates a constant fetch node.
- enum() : Enum_
- Creates an enum builder.
- enumCase() : EnumCase
- Creates an enum case builder.
- funcCall() : FuncCall
- Creates a function call node.
- function() : Function_
- Creates a function builder.
- interface() : Interface_
- Creates an interface builder.
- method() : Method
- Creates a method builder.
- methodCall() : MethodCall
- Creates a method call node.
- namespace() : Namespace_
- Creates a namespace builder.
- new() : New_
- Creates an object creation node.
- param() : Param
- Creates a parameter builder.
- property() : Property
- Creates a property builder.
- propertyFetch() : PropertyFetch
- Creates a property fetch node.
- staticCall() : StaticCall
- Creates a static method call node.
- trait() : Trait_
- Creates a trait builder.
- traitUseAdaptation() : TraitUseAdaptation
- Creates a trait use adaptation builder.
- use() : Use_
- Creates a namespace/class use builder.
- useConst() : Use_
- Creates a constant use builder.
- useFunction() : Use_
- Creates a function use builder.
- useTrait() : TraitUse
- Creates a trait use builder.
- val() : Expr
- Creates node a for a literal value.
- var() : Variable
- Creates variable node.
- normalizeStringExpr() : Expr
Methods
args()
Normalizes an argument list.
public
args(array<string|int, mixed> $args) : array<int, Arg>
Creates Arg nodes for all arguments and converts literal values to expressions.
Parameters
- $args : array<string|int, mixed>
-
List of arguments to normalize
Return values
array<int, Arg>attribute()
Creates an attribute node.
public
attribute(string|Name $name[, array<string|int, mixed> $args = [] ]) : Attribute
Parameters
- $name : string|Name
-
Name of the attribute
- $args : array<string|int, mixed> = []
-
Attribute named arguments
Return values
Attributeclass()
Creates a class builder.
public
class(string $name) : Class_
Parameters
- $name : string
-
Name of the class
Return values
Class_ —The created class builder
classConst()
Creates a class constant builder.
public
classConst(string|Identifier $name, Expr|bool|null|int|float|string|array<string|int, mixed> $value) : ClassConst
Parameters
- $name : string|Identifier
-
Name
- $value : Expr|bool|null|int|float|string|array<string|int, mixed>
-
Value
Return values
ClassConst —The created use const builder
classConstFetch()
Creates a class constant fetch node.
public
classConstFetch(string|Name|Expr $class, string|Identifier|Expr $name) : ClassConstFetch
Parameters
- $class : string|Name|Expr
-
Class name
- $name : string|Identifier|Expr
-
Constant name
Return values
ClassConstFetchconcat()
Creates nested Concat nodes from a list of expressions.
public
concat(Expr|string ...$exprs) : Concat
Parameters
- $exprs : Expr|string
-
Expressions or literal strings
Return values
ConcatconstFetch()
Creates a constant fetch node.
public
constFetch(string|Name $name) : ConstFetch
Parameters
- $name : string|Name
-
Constant name
Return values
ConstFetchenum()
Creates an enum builder.
public
enum(string $name) : Enum_
Parameters
- $name : string
-
Name of the enum
Return values
Enum_ —The created enum builder
enumCase()
Creates an enum case builder.
public
enumCase(string|Identifier $name) : EnumCase
Parameters
- $name : string|Identifier
-
Name
Return values
EnumCase —The created use const builder
funcCall()
Creates a function call node.
public
funcCall(string|Name|Expr $name[, array<string|int, mixed> $args = [] ]) : FuncCall
Parameters
Return values
FuncCallfunction()
Creates a function builder.
public
function(string $name) : Function_
Parameters
- $name : string
-
Name of the function
Return values
Function_ —The created function builder
interface()
Creates an interface builder.
public
interface(string $name) : Interface_
Parameters
- $name : string
-
Name of the interface
Return values
Interface_ —The created interface builder
method()
Creates a method builder.
public
method(string $name) : Method
Parameters
- $name : string
-
Name of the method
Return values
Method —The created method builder
methodCall()
Creates a method call node.
public
methodCall(Expr $var, string|Identifier|Expr $name[, array<string|int, mixed> $args = [] ]) : MethodCall
Parameters
- $var : Expr
-
Variable the method is called on
- $name : string|Identifier|Expr
-
Method name
- $args : array<string|int, mixed> = []
-
Method arguments
Return values
MethodCallnamespace()
Creates a namespace builder.
public
namespace(null|string|Name $name) : Namespace_
Parameters
- $name : null|string|Name
-
Name of the namespace
Return values
Namespace_ —The created namespace builder
new()
Creates an object creation node.
public
new(string|Name|Expr $class[, array<string|int, mixed> $args = [] ]) : New_
Parameters
Return values
New_param()
Creates a parameter builder.
public
param(string $name) : Param
Parameters
- $name : string
-
Name of the parameter
Return values
Param —The created parameter builder
property()
Creates a property builder.
public
property(string $name) : Property
Parameters
- $name : string
-
Name of the property
Return values
Property —The created property builder
propertyFetch()
Creates a property fetch node.
public
propertyFetch(Expr $var, string|Identifier|Expr $name) : PropertyFetch
Parameters
- $var : Expr
-
Variable holding object
- $name : string|Identifier|Expr
-
Property name
Return values
PropertyFetchstaticCall()
Creates a static method call node.
public
staticCall(string|Name|Expr $class, string|Identifier|Expr $name[, array<string|int, mixed> $args = [] ]) : StaticCall
Parameters
- $class : string|Name|Expr
-
Class name
- $name : string|Identifier|Expr
-
Method name
- $args : array<string|int, mixed> = []
-
Method arguments
Return values
StaticCalltrait()
Creates a trait builder.
public
trait(string $name) : Trait_
Parameters
- $name : string
-
Name of the trait
Return values
Trait_ —The created trait builder
traitUseAdaptation()
Creates a trait use adaptation builder.
public
traitUseAdaptation(Name|string|null $trait[, Identifier|string $method = null ]) : TraitUseAdaptation
Parameters
- $trait : Name|string|null
-
Trait name
- $method : Identifier|string = null
-
Method name
Return values
TraitUseAdaptation —The created trait use adaptation builder
use()
Creates a namespace/class use builder.
public
use(Name|string $name) : Use_
Parameters
- $name : Name|string
-
Name of the entity (namespace or class) to alias
Return values
Use_ —The created use builder
useConst()
Creates a constant use builder.
public
useConst(Name|string $name) : Use_
Parameters
- $name : Name|string
-
Name of the const to alias
Return values
Use_ —The created use const builder
useFunction()
Creates a function use builder.
public
useFunction(Name|string $name) : Use_
Parameters
- $name : Name|string
-
Name of the function to alias
Return values
Use_ —The created use function builder
useTrait()
Creates a trait use builder.
public
useTrait(Name|string ...$traits) : TraitUse
Parameters
- $traits : Name|string
-
Trait names
Return values
TraitUse —The created trait use builder
val()
Creates node a for a literal value.
public
val(Expr|bool|null|int|float|string|array<string|int, mixed>|UnitEnum $value) : Expr
Parameters
- $value : Expr|bool|null|int|float|string|array<string|int, mixed>|UnitEnum
-
$value
Return values
Exprvar()
Creates variable node.
public
var(string|Expr $name) : Variable
Parameters
- $name : string|Expr
-
Name
Return values
VariablenormalizeStringExpr()
private
normalizeStringExpr(string|Expr $expr) : Expr
Parameters
- $expr : string|Expr