PHP Interface PDepend\Source\AST\ASTNode

Since: 2.3
Afficher le fichier Open project: pdepend/pdepend Interface Usage Examples

Méthodes publiques

Méthode Description
configureLinesAndColumns ( integer $startLine, integer $endLine, integer $startColumn, integer $endColumn ) : void For better performance we have moved the single setter methods for the node columns and lines into this configure method.
findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[] This method will search recursive for all child nodes that are an instance of the given $targetType. The returned value will be an empty array if no child exists for that.
getChild ( integer $index ) : PDepend\Source\AST\ASTNode Returns the node instance for the given index or throws an exception.
getChildren ( ) : PDepend\Source\AST\ASTNode[] This method returns all direct children of the actual node.
getComment ( ) : string Returns a doc comment for this node or null when no comment was found.
getEndColumn ( ) : integer Returns the end column for this ast node.
getEndLine ( ) : integer Returns the end line for this ast node.
getFirstChildOfType ( string $targetType ) : PDepend\Source\AST\ASTNode This method will search recursive for the first child node that is an instance of the given $targetType. The returned value will be null if no child exists for that.
getImage ( ) : string Returns the source image of this ast node.
getParent ( ) : PDepend\Source\AST\ASTNode Returns the parent node of this node or null when this node is the root of a node tree.
getParentsOfType ( string $parentType ) : PDepend\Source\AST\ASTNode[] Traverses up the node tree and finds all parent nodes that are instances of $parentType.
getStartColumn ( ) : integer Returns the start column for this ast node.
getStartLine ( ) : integer Returns the start line for this ast node.
setComment ( string $comment ) : void Sets the raw doc comment for this node.
setParent ( PDepend\Source\AST\ASTNode $node ) : void Sets the parent node of this node.

Method Details

configureLinesAndColumns() public méthode

For better performance we have moved the single setter methods for the node columns and lines into this configure method.
Since: 0.9.10
public configureLinesAndColumns ( integer $startLine, integer $endLine, integer $startColumn, integer $endColumn ) : void
$startLine integer
$endLine integer
$startColumn integer
$endColumn integer
Résultat void

findChildrenOfType() public méthode

This method will search recursive for all child nodes that are an instance of the given $targetType. The returned value will be an empty array if no child exists for that.
public findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[]
$targetType string Searched class or interface type.
$results array
Résultat PDepend\Source\AST\ASTNode[]

getChild() public méthode

Returns the node instance for the given index or throws an exception.
public getChild ( integer $index ) : PDepend\Source\AST\ASTNode
$index integer
Résultat PDepend\Source\AST\ASTNode

getChildren() public méthode

This method returns all direct children of the actual node.
public getChildren ( ) : PDepend\Source\AST\ASTNode[]
Résultat PDepend\Source\AST\ASTNode[]

getComment() public méthode

Returns a doc comment for this node or null when no comment was found.
public getComment ( ) : string
Résultat string

getEndColumn() public méthode

Returns the end column for this ast node.
public getEndColumn ( ) : integer
Résultat integer

getEndLine() public méthode

Returns the end line for this ast node.
public getEndLine ( ) : integer
Résultat integer

getFirstChildOfType() public méthode

This method will search recursive for the first child node that is an instance of the given $targetType. The returned value will be null if no child exists for that.
public getFirstChildOfType ( string $targetType ) : PDepend\Source\AST\ASTNode
$targetType string
Résultat PDepend\Source\AST\ASTNode

getImage() public méthode

Returns the source image of this ast node.
public getImage ( ) : string
Résultat string

getParent() public méthode

Returns the parent node of this node or null when this node is the root of a node tree.
public getParent ( ) : PDepend\Source\AST\ASTNode
Résultat PDepend\Source\AST\ASTNode

getParentsOfType() public méthode

Traverses up the node tree and finds all parent nodes that are instances of $parentType.
public getParentsOfType ( string $parentType ) : PDepend\Source\AST\ASTNode[]
$parentType string
Résultat PDepend\Source\AST\ASTNode[]

getStartColumn() public méthode

Returns the start column for this ast node.
public getStartColumn ( ) : integer
Résultat integer

getStartLine() public méthode

Returns the start line for this ast node.
public getStartLine ( ) : integer
Résultat integer

setComment() public méthode

Sets the raw doc comment for this node.
public setComment ( string $comment ) : void
$comment string The doc comment block for this node.
Résultat void

setParent() public méthode

Sets the parent node of this node.
public setParent ( PDepend\Source\AST\ASTNode $node ) : void
$node PDepend\Source\AST\ASTNode
Résultat void