PHP Class PhpParser\BuilderAbstract

Inheritance: implements phpparser\Builder
Afficher le fichier Open project: nikic/PHP-Parser

Méthodes protégées

Méthode 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 méthode

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
Résultat PhpParser\Comment\Doc The normalized doc comment

normalizeName() protected méthode

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
Résultat PhpParser\Node\Name The normalized name

normalizeNode() protected méthode

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
Résultat phpparser\Node The normalized node

normalizeType() protected méthode

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
Résultat PhpParser\Node\Name | string | PhpParser\Node\NullableType The normalized type

normalizeValue() protected méthode

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
Résultat PhpParser\Node\Expr The normalized value

setModifier() protected méthode

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