PHP Class PhpParser\NodeAbstract

Inheritance: implements phpparser\Node, implements JsonSerializable
Show file Open project: nikic/php-parser Class Usage Examples

Protected Properties

Property Type Description
$attributes

Public Methods

Method Description
__construct ( array $attributes = [] ) Creates a Node.
getAttribute ( $key, $default = null )
getAttributes ( )
getDocComment ( ) : null | Comment\Doc Gets the doc comment of the node.
getLine ( ) : integer Gets line the node started in.
getType ( ) : string Gets the type of the node.
hasAttribute ( $key )
jsonSerialize ( )
setAttribute ( $key, $value )
setDocComment ( Comment\Doc $docComment ) Sets the doc comment of the node.
setLine ( integer $line ) Sets line the node started in.

Method Details

__construct() public method

Creates a Node.
public __construct ( array $attributes = [] )
$attributes array Array of attributes

getAttribute() public method

public getAttribute ( $key, $default = null )

getAttributes() public method

public getAttributes ( )

getDocComment() public method

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

getLine() public method

Gets line the node started in.
public getLine ( ) : integer
return integer Line

getType() public method

Gets the type of the node.
public getType ( ) : string
return string Type of the node

hasAttribute() public method

public hasAttribute ( $key )

jsonSerialize() public method

public jsonSerialize ( )

setAttribute() public method

public setAttribute ( $key, $value )

setDocComment() public method

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 method

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

Property Details

$attributes protected property

protected $attributes