PHP Класс PhpParser\Comment

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

Защищенные свойства (Protected)

Свойство Тип Описание
$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