PHP Class PhpParser\Error

Inheritance: extends RuntimeException
Afficher le fichier Open project: nikic/php-parser Class Usage Examples

Protected Properties

Свойство Type Description
$attributes
$rawMessage

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
updateMessage ( ) Updates the exception message after a change to rawMessage or rawLine.

Private Methods

Méthode Description
toColumn ( $code, $pos )

Method Details

__construct() public méthode

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() public méthode

Gets the attributes of the node/token the error occurred at.
public getAttributes ( ) : array
Résultat array

getEndColumn() public méthode

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
Résultat integer

getEndLine() public méthode

Gets the line the error ends in.
public getEndLine ( ) : integer
Résultat integer Error end line

getMessageWithColumnInfo() public méthode

public getMessageWithColumnInfo ( $code )

getRawMessage() public méthode

Gets the error message
public getRawMessage ( ) : string
Résultat string Error message

getStartColumn() public méthode

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
Résultat integer

getStartLine() public méthode

Gets the line the error starts in.
public getStartLine ( ) : integer
Résultat integer Error start line

hasColumnInfo() public méthode

For column information enable the startFilePos and endFilePos in the lexer options.
public hasColumnInfo ( ) : boolean
Résultat boolean

setAttributes() public méthode

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

setRawMessage() public méthode

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

setStartLine() public méthode

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

updateMessage() protected méthode

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

Property Details

$attributes protected_oe property

protected $attributes

$rawMessage protected_oe property

protected $rawMessage