PHP Class PhpParser\BuilderAbstract

Inheritance: implements phpparser\Builder
Show file Open project: nikic/PHP-Parser

Protected Methods

Method Description
normalizeDocComment ( PhpParser\Comment\Doc | string $docComment ) : PhpParser\Comment\Doc Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
normalizeName ( Name | string $name ) : Name Normalizes a name: Converts plain string names to PhpParser\Node\Name.
normalizeNode ( phpparser\Node | phpparser\Builder $node ) : phpparser\Node Normalizes a node: Converts builder objects to nodes.
normalizeType ( Name | string | NullableType $type ) : Name | string | NullableType Normalizes a type: Converts plain-text type names into proper AST representation.
normalizeValue ( mixed $value ) : PhpParser\Node\Expr Normalizes a value: Converts nulls, booleans, integers, floats, strings and arrays into their respective nodes
setModifier ( integer $modifier ) Sets a modifier in the $this->type property.

Method Details

normalizeDocComment() protected method

Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
protected normalizeDocComment ( PhpParser\Comment\Doc | string $docComment ) : PhpParser\Comment\Doc
$docComment PhpParser\Comment\Doc | string The doc comment to normalize
return PhpParser\Comment\Doc The normalized doc comment

normalizeName() protected method

Normalizes a name: Converts plain string names to PhpParser\Node\Name.
protected normalizeName ( Name | string $name ) : Name
$name PhpParser\Node\Name | string The name to normalize
return PhpParser\Node\Name The normalized name

normalizeNode() protected method

Normalizes a node: Converts builder objects to nodes.
protected normalizeNode ( phpparser\Node | phpparser\Builder $node ) : phpparser\Node
$node phpparser\Node | phpparser\Builder The node to normalize
return phpparser\Node The normalized node

normalizeType() protected method

In particular, builtin types are left as strings, custom types become Names and nullables are wrapped in NullableType nodes.
protected normalizeType ( Name | string | NullableType $type ) : Name | string | NullableType
$type PhpParser\Node\Name | string | PhpParser\Node\NullableType The type to normalize
return PhpParser\Node\Name | string | PhpParser\Node\NullableType The normalized type

normalizeValue() protected method

Normalizes a value: Converts nulls, booleans, integers, floats, strings and arrays into their respective nodes
protected normalizeValue ( mixed $value ) : PhpParser\Node\Expr
$value mixed The value to normalize
return PhpParser\Node\Expr The normalized value

setModifier() protected method

Sets a modifier in the $this->type property.
protected setModifier ( integer $modifier )
$modifier integer Modifier to set