Methods |
public
static
|
normalizeNode(Node|Builder $node): Node
Normalizes a node: Converts builder objects to nodes.
Normalizes a node: Converts builder objects to nodes.
Parameters
$node |
The node to normalize
|
Returns
|
#
|
public
static
|
normalizeStmt(Node|Builder $node): Stmt
Normalizes a node to a statement.
Normalizes a node to a statement.
Expressions are wrapped in a Stmt\Expression node.
Parameters
$node |
The node to normalize
|
Returns
The normalized statement node
|
#
|
public
static
|
normalizeIdentifier(string|Identifier $name): Identifier
Normalizes strings to Identifier.
Normalizes strings to Identifier.
Parameters
$name |
The identifier to normalize
|
Returns
The normalized identifier
|
#
|
public
static
|
normalizeIdentifierOrExpr(string|Identifier|Expr $name): Identifier|Expr
Normalizes strings to Identifier, also allowing expressions.
Normalizes strings to Identifier, also allowing expressions.
Parameters
$name |
The identifier to normalize
|
Returns
The normalized identifier or expression
|
#
|
public
static
|
normalizeName(Name|string $name): Name
Normalizes a name: Converts string names to Name nodes.
Normalizes a name: Converts string names to Name nodes.
Parameters
$name |
The name to normalize
|
Returns
|
#
|
public
static
|
normalizeNameOrExpr(Expr|Name|string $name): Name|Expr
Normalizes a name: Converts string names to Name nodes, while also allowing expressions.
Normalizes a name: Converts string names to Name nodes, while also allowing expressions.
Parameters
$name |
The name to normalize
|
Returns
The normalized name or expression
|
#
|
public
static
|
normalizeType(string|Name|Identifier|ComplexType $type): Name|Identifier|ComplexType
Normalizes a type: Converts plain-text type names into proper AST representation.
Normalizes a type: Converts plain-text type names into proper AST representation.
In particular, builtin types become Identifiers, custom types become Names and nullables
are wrapped in NullableType nodes.
Parameters
$type |
The type to normalize
|
Returns
|
#
|
public
static
|
normalizeValue(Expr|bool|null|int|float|string|array|UnitEnum $value): Expr
Normalizes a value: Converts nulls, booleans, integers,
floats, strings and arrays into their respective nodes
Normalizes a value: Converts nulls, booleans, integers,
floats, strings and arrays into their respective nodes
Parameters
$value |
The value to normalize
|
Returns
|
#
|
public
static
|
normalizeDocComment(Doc|string $docComment): Doc
Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
Parameters
$docComment |
The doc comment to normalize
|
Returns
The normalized doc comment
|
#
|
public
static
|
normalizeAttribute(Attribute|AttributeGroup $attribute): AttributeGroup
Normalizes a attribute: Converts attribute to the Attribute Group if needed.
Normalizes a attribute: Converts attribute to the Attribute Group if needed.
Returns
|
#
|
public
static
|
addModifier(int $modifiers, int $modifier): int
Adds a modifier and returns new modifier bitmask.
Adds a modifier and returns new modifier bitmask.
Parameters
$modifiers |
Existing modifiers
|
$modifier |
Modifier to set
|
Returns
|
#
|
public
static
|
addClassModifier(int $existingModifiers, int $modifierToSet): int
Adds a modifier and returns new modifier bitmask.
Adds a modifier and returns new modifier bitmask.
Returns
|
#
|