Menu

## Error extends RuntimeException
in package

Error.php : 5

### Table of Contents

$attributes : mixed
$rawMessage : mixed
__construct() : mixed
  Creates an Exception signifying a parse error.
getAttributes() : array<string|int, mixed>
  Gets the attributes of the node/token the error occurred at.
getEndColumn() : int
  Gets the end column (1-based) into the line where the error ended.
getEndLine() : int
  Gets the line the error ends in.
getMessageWithColumnInfo() : string
  Formats message including line and column information.
getRawMessage() : string
  Gets the error message
getStartColumn() : int
  Gets the start column (1-based) into the line where the error started.
getStartLine() : int
  Gets the line the error starts in.
hasColumnInfo() : bool
  Returns whether the error has start and end column information.
setAttributes() : mixed
  Sets the attributes of the node/token the error occurred at.
setRawMessage() : mixed
  Sets the line of the PHP file the error occurred in.
setStartLine() : mixed
  Sets the line the error starts in.
updateMessage() : mixed
  Updates the exception message after a change to rawMessage or rawLine.
toColumn() : int
  Converts a file offset into a column.

### Properties

#### $attributes

Error.php : 8
`protected mixed $attributes`

#### $rawMessage

Error.php : 7
`protected mixed $rawMessage`

### Methods

#### __construct()

Error.php : 17

Creates an Exception signifying a parse error.

`public __construct(string $message[, array<string|int, mixed>|int $attributes = [] ]) : mixed`

##### Parameters

$message : string

  Error message

$attributes : array<string|int, mixed>|int = []

  Attributes of node/token where error occurred (or start line of error -- deprecated)

##### Return values

mixed —

#### getAttributes()

Error.php : 59

Gets the attributes of the node/token the error occurred at.

`public getAttributes() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### getEndColumn()

Error.php : 124

Gets the end column (1-based) into the line where the error ended.

`public getEndColumn(string $code) : int`

##### Parameters

$code : string

  Source code of the file

##### Return values

int —

#### getEndLine()

Error.php : 50

Gets the line the error ends in.

`public getEndLine() : int`

##### Return values

int —

Error end line

#### getMessageWithColumnInfo()

Error.php : 139

Formats message including line and column information.

`public getMessageWithColumnInfo(string $code) : string`

##### Parameters

$code : string

  Source code associated with the error, for calculation of the columns

##### Return values

string —

Formatted message

#### getRawMessage()

Error.php : 32

Gets the error message

`public getRawMessage() : string`

##### Return values

string —

Error message

#### getStartColumn()

Error.php : 110

Gets the start column (1-based) into the line where the error started.

`public getStartColumn(string $code) : int`

##### Parameters

$code : string

  Source code of the file

##### Return values

int —

#### getStartLine()

Error.php : 41

Gets the line the error starts in.

`public getStartLine() : int`

##### Return values

int —

Error start line

#### hasColumnInfo()

Error.php : 100

Returns whether the error has start and end column information.

`public hasColumnInfo() : bool`

For column information enable the startFilePos and endFilePos in the lexer options.

##### Return values

bool —

#### setAttributes()

Error.php : 68

Sets the attributes of the node/token the error occurred at.

`public setAttributes(array<string|int, mixed> $attributes) : mixed`

##### Parameters

$attributes : array<string|int, mixed>

##### Return values

mixed —

#### setRawMessage()

Error.php : 78

Sets the line of the PHP file the error occurred in.

`public setRawMessage(string $message) : mixed`

##### Parameters

$message : string

  Error message

##### Return values

mixed —

#### setStartLine()

Error.php : 88

Sets the line the error starts in.

`public setStartLine(int $line) : mixed`

##### Parameters

$line : int

  Error start line

##### Return values

mixed —

#### updateMessage()

Error.php : 171

Updates the exception message after a change to rawMessage or rawLine.

`protected updateMessage() : mixed`

##### Return values

mixed —

#### toColumn()

Error.php : 155

Converts a file offset into a column.

`private toColumn(string $code, int $pos) : int`

##### Parameters

$code : string

  Source code that $pos indexes into

$pos : int

  0-based position in $code

##### Return values

int —

1-based column (relative to start of line)

## Search results