PHP Класс PhpParser\Error

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

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

Свойство Тип Описание
$attributes
$rawMessage

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

Метод Описание
__construct ( string $message, array | integer $attributes = [] ) Creates an Exception signifying a parse error.
getAttributes ( ) : array Gets the attributes of the node/token the error occurred at.
getEndColumn ( string $code ) : integer Gets the end column (1-based) into the line where the error ended.
getEndLine ( ) : integer Gets the line the error ends in.
getMessageWithColumnInfo ( $code )
getRawMessage ( ) : string Gets the error message
getStartColumn ( string $code ) : integer Gets the start column (1-based) into the line where the error started.
getStartLine ( ) : integer Gets the line the error starts in.
hasColumnInfo ( ) : boolean Returns whether the error has start and end column information.
setAttributes ( array $attributes ) Sets the attributes of the node/token the error occured at.
setRawMessage ( string $message ) Sets the line of the PHP file the error occurred in.
setStartLine ( integer $line ) Sets the line the error starts in.

Защищенные методы

Метод Описание
updateMessage ( ) Updates the exception message after a change to rawMessage or rawLine.

Приватные методы

Метод Описание
toColumn ( $code, $pos )

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

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

Creates an Exception signifying a parse error.
public __construct ( string $message, array | integer $attributes = [] )
$message string Error message
$attributes array | integer Attributes of node/token where error occurred (or start line of error -- deprecated)

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

Gets the attributes of the node/token the error occurred at.
public getAttributes ( ) : array
Результат array

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

Gets the end column (1-based) into the line where the error ended.
public getEndColumn ( string $code ) : integer
$code string Source code of the file
Результат integer

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

Gets the line the error ends in.
public getEndLine ( ) : integer
Результат integer Error end line

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

public getMessageWithColumnInfo ( $code )

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

Gets the error message
public getRawMessage ( ) : string
Результат string Error message

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

Gets the start column (1-based) into the line where the error started.
public getStartColumn ( string $code ) : integer
$code string Source code of the file
Результат integer

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

Gets the line the error starts in.
public getStartLine ( ) : integer
Результат integer Error start line

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

For column information enable the startFilePos and endFilePos in the lexer options.
public hasColumnInfo ( ) : boolean
Результат boolean

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

Sets the attributes of the node/token the error occured at.
public setAttributes ( array $attributes )
$attributes array

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

Sets the line of the PHP file the error occurred in.
public setRawMessage ( string $message )
$message string Error message

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

Sets the line the error starts in.
public setStartLine ( integer $line )
$line integer Error start line

updateMessage() защищенный Метод

Updates the exception message after a change to rawMessage or rawLine.
protected updateMessage ( )

Описание свойств

$attributes защищенное свойство

protected $attributes

$rawMessage защищенное свойство

protected $rawMessage