PHP 클래스 PhpParser\Comment

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

보호된 프로퍼티들

프로퍼티 타입 설명
$filePos
$line
$text

공개 메소드들

메소드 설명
__construct ( string $text, integer $startLine, integer $startFilePos ) Constructs a comment node.
__toString ( ) : string Gets the comment text.
getFilePos ( ) : integer Gets the file offset the comment started on.
getLine ( ) : integer Gets the line number the comment started on.
getReformattedText ( ) : mixed | string Gets the reformatted comment text.
getText ( ) : string Gets the comment text.
jsonSerialize ( )

비공개 메소드들

메소드 설명
getShortestWhitespacePrefixLen ( $str )

메소드 상세

__construct() 공개 메소드

Constructs a comment node.
public __construct ( string $text, integer $startLine, integer $startFilePos )
$text string Comment text (including comment delimiters like /*)
$startLine integer Line number the comment started on
$startFilePos integer File offset the comment started on

__toString() 공개 메소드

Gets the comment text.
public __toString ( ) : string
리턴 string The comment text (including comment delimiters like /*)

getFilePos() 공개 메소드

Gets the file offset the comment started on.
public getFilePos ( ) : integer
리턴 integer File offset

getLine() 공개 메소드

Gets the line number the comment started on.
public getLine ( ) : integer
리턴 integer Line number

getReformattedText() 공개 메소드

"Reformatted" here means that we try to clean up the whitespace at the starts of the lines. This is necessary because we receive the comments without trailing whitespace on the first line, but with trailing whitespace on all subsequent lines.
public getReformattedText ( ) : mixed | string
리턴 mixed | string

getText() 공개 메소드

Gets the comment text.
public getText ( ) : string
리턴 string The comment text (including comment delimiters like /*)

jsonSerialize() 공개 메소드

public jsonSerialize ( )

프로퍼티 상세

$filePos 보호되어 있는 프로퍼티

protected $filePos

$line 보호되어 있는 프로퍼티

protected $line

$text 보호되어 있는 프로퍼티

protected $text