PHP 인터페이스 PhpParser\Node

파일 보기 프로젝트 열기: nikic/php-parser 0 사용 예제들

공개 메소드들

메소드 설명
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