PHP Class PDepend\Source\AST\ASTAnonymousClass

Since: 2.3
Inheritance: extends PDepend\Source\AST\ASTClass, implements PDepend\Source\AST\ASTNode
Datei anzeigen Open project: pdepend/pdepend

Protected Properties

Property Type Description
$metadata string Metadata for this node instance, serialized in a string. This string contains the start, end line, and the start, end column and the node image in a colon separated string.
$parent PDepend\Source\AST\ASTNode The parent node of this node or null when this node is the root of a node tree.

Public Methods

Method Description
__sleep ( ) : array The magic sleep method will be called by PHP's runtime environment right before an instance of this class gets serialized. It should return an array with those property names that should be serialized for this class.
__wakeup ( ) : void The magic wakeup method will be called by PHP's runtime environment when a serialized instance of this class was unserialized. This implementation of the wakeup method will register this object in the the global class context.
accept ( PDepend\Source\ASTVisitor\ASTVisitor $visitor, mixed $data = null ) : void
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.
getEndColumn ( ) : integer Returns the end column for this ast node.
getEndLine ( ) : integer Returns the end line for this ast node.
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.
isAnonymous ( ) : boolean Will return true if this class was declared anonymous in an allocation expression.
prependChild ( PDepend\Source\AST\ASTNode $node ) : void This method adds a new child node at the first position of the children.
setImage ( string $image ) : void
setParent ( PDepend\Source\AST\ASTNode $node ) : void Sets the parent node of this node.

Protected Methods

Method Description
getMetadata ( integer $index ) : mixed Returns the value that was stored under the given index.
getMetadataInteger ( integer $index ) : integer Returns an integer value that was stored under the given index.
getMetadataSize ( ) : integer Returns the total number of the used property bag.
setMetadata ( integer $index, mixed $value ) : void Stores the given value under the given index in an internal storage container.
setMetadataInteger ( integer $index, integer $value ) : void Stores an integer value under the given index in the internally used data string.

Method Details

__sleep() public method

The magic sleep method will be called by PHP's runtime environment right before an instance of this class gets serialized. It should return an array with those property names that should be serialized for this class.
Since: 0.10.0
public __sleep ( ) : array
return array

__wakeup() public method

The magic wakeup method will be called by PHP's runtime environment when a serialized instance of this class was unserialized. This implementation of the wakeup method will register this object in the the global class context.
public __wakeup ( ) : void
return void

accept() public method

public accept ( PDepend\Source\ASTVisitor\ASTVisitor $visitor, mixed $data = null ) : void
$visitor PDepend\Source\ASTVisitor\ASTVisitor
$data mixed
return void

configureLinesAndColumns() public method

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
return void

getEndColumn() public method

Returns the end column for this ast node.
public getEndColumn ( ) : integer
return integer

getEndLine() public method

Returns the end line for this ast node.
public getEndLine ( ) : integer
return integer

getImage() public method

Returns the source image of this ast node.
public getImage ( ) : string
return string

getMetadata() protected method

Returns the value that was stored under the given index.
Since: 0.10.4
protected getMetadata ( integer $index ) : mixed
$index integer
return mixed

getMetadataInteger() protected method

Returns an integer value that was stored under the given index.
Since: 0.10.4
protected getMetadataInteger ( integer $index ) : integer
$index integer
return integer

getMetadataSize() protected method

Returns the total number of the used property bag.
Since: 0.10.4
protected getMetadataSize ( ) : integer
return integer

getParent() public method

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
return PDepend\Source\AST\ASTNode

getParentsOfType() public method

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
return PDepend\Source\AST\ASTNode[]

getStartColumn() public method

Returns the start column for this ast node.
public getStartColumn ( ) : integer
return integer

getStartLine() public method

Returns the start line for this ast node.
public getStartLine ( ) : integer
return integer

isAnonymous() public method

Will return true if this class was declared anonymous in an allocation expression.
public isAnonymous ( ) : boolean
return boolean

prependChild() public method

This method adds a new child node at the first position of the children.
public prependChild ( PDepend\Source\AST\ASTNode $node ) : void
$node PDepend\Source\AST\ASTNode
return void

setImage() public method

public setImage ( string $image ) : void
$image string
return void

setMetadata() protected method

Stores the given value under the given index in an internal storage container.
Since: 0.10.4
protected setMetadata ( integer $index, mixed $value ) : void
$index integer
$value mixed
return void

setMetadataInteger() protected method

Stores an integer value under the given index in the internally used data string.
Since: 0.10.4
protected setMetadataInteger ( integer $index, integer $value ) : void
$index integer
$value integer
return void

setParent() public method

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

Property Details

$metadata protected_oe property

Metadata for this node instance, serialized in a string. This string contains the start, end line, and the start, end column and the node image in a colon separated string.
Since: 0.10.4
protected string $metadata
return string

$parent protected_oe property

The parent node of this node or null when this node is the root of a node tree.
protected ASTNode,PDepend\Source\AST $parent
return PDepend\Source\AST\ASTNode