PHP Interface PhpParser\Node

Afficher le fichier Open project: nikic/php-parser Interface Usage Examples

Méthodes publiques

Méthode Description
getAttribute ( string $key, mixed $default = null ) : mixed Returns the value of an attribute.
getAttributes ( ) : array Returns all attributes for the given node.
getDocComment ( ) : null | Comment\Doc Gets the doc comment of the node.
getLine ( ) : integer Gets line the node started in.
getSubNodeNames ( ) : array Gets the names of the sub nodes.
getType ( ) : string Gets the type of the node.
hasAttribute ( string $key ) : boolean Returns whether an attribute exists.
setAttribute ( string $key, mixed $value ) Sets an attribute on a node.
setDocComment ( Comment\Doc $docComment ) Sets the doc comment of the node.
setLine ( integer $line ) Sets line the node started in.

Method Details

getAttribute() public méthode

Returns the value of an attribute.
public getAttribute ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Résultat mixed

getAttributes() public méthode

Returns all attributes for the given node.
public getAttributes ( ) : array
Résultat array

getDocComment() public méthode

The doc comment has to be the last comment associated with the node.
public getDocComment ( ) : null | Comment\Doc
Résultat null | Comment\Doc Doc comment object or null

getLine() public méthode

Gets line the node started in.
public getLine ( ) : integer
Résultat integer Line

getSubNodeNames() public méthode

Gets the names of the sub nodes.
public getSubNodeNames ( ) : array
Résultat array Names of sub nodes

getType() public méthode

Gets the type of the node.
public getType ( ) : string
Résultat string Type of the node

hasAttribute() public méthode

Returns whether an attribute exists.
public hasAttribute ( string $key ) : boolean
$key string
Résultat boolean

setAttribute() public méthode

Sets an attribute on a node.
public setAttribute ( string $key, mixed $value )
$key string
$value mixed

setDocComment() public méthode

This will either replace an existing doc comment or add it to the comments array.
public setDocComment ( Comment\Doc $docComment )
$docComment Comment\Doc Doc comment to set

setLine() public méthode

Sets line the node started in.
public setLine ( integer $line )
$line integer Line