PHP Интерфейс PhpParser\Node

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

getAttribute() публичный Метод

Returns the value of an attribute.
public getAttribute ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Результат mixed

getAttributes() публичный Метод

Returns all attributes for the given node.
public getAttributes ( ) : array
Результат array

getDocComment() публичный Метод

The doc comment has to be the last comment associated with the node.
public getDocComment ( ) : null | Comment\Doc
Результат null | Comment\Doc Doc comment object or null

getLine() публичный Метод

Gets line the node started in.
public getLine ( ) : integer
Результат integer Line

getSubNodeNames() публичный Метод

Gets the names of the sub nodes.
public getSubNodeNames ( ) : array
Результат array Names of sub nodes

getType() публичный Метод

Gets the type of the node.
public getType ( ) : string
Результат string Type of the node

hasAttribute() публичный Метод

Returns whether an attribute exists.
public hasAttribute ( string $key ) : boolean
$key string
Результат boolean

setAttribute() публичный Метод

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

setDocComment() публичный Метод

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() публичный Метод

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