HumHub Documentation (unofficial)

SyntaxError extends Error
in package

\Exception thrown when a syntax error occurs during lexing or parsing of a template.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Properties

$lineno  : mixed
$name  : mixed
$rawMessage  : mixed
$sourceCode  : mixed
$sourcePath  : mixed

Methods

__construct()  : mixed
Constructor.
addSuggestions()  : void
Tweaks the error message to include suggestions.
appendMessage()  : void
getRawMessage()  : string
getSourceContext()  : Source|null
getTemplateLine()  : int
guess()  : void
setSourceContext()  : void
setTemplateLine()  : void
guessTemplateInfo()  : void
updateRepr()  : void

Properties

$lineno

private mixed $lineno

$rawMessage

private mixed $rawMessage

$sourceCode

private mixed $sourceCode

$sourcePath

private mixed $sourcePath

Methods

__construct()

Constructor.

public __construct(string $message[, int $lineno = -1 ][, Source|null $source = null ][, Throwable|null $previous = null ]) : mixed

By default, automatic guessing is enabled.

Parameters
$message : string

The error message

$lineno : int = -1

The template line where the error occurred

$source : Source|null = null

The source context where the error occurred

$previous : Throwable|null = null

addSuggestions()

Tweaks the error message to include suggestions.

public addSuggestions(string $name, array<string|int, mixed> $items) : void
Parameters
$name : string

The original name of the item that does not exist

$items : array<string|int, mixed>

An array of possible items

appendMessage()

public appendMessage(mixed $rawMessage) : void
Parameters
$rawMessage : mixed

getRawMessage()

public getRawMessage() : string
Return values
string

getTemplateLine()

public getTemplateLine() : int
Return values
int

guess()

public guess() : void

setSourceContext()

public setSourceContext([Source|null $source = null ]) : void
Parameters
$source : Source|null = null

setTemplateLine()

public setTemplateLine(int $lineno) : void
Parameters
$lineno : int

guessTemplateInfo()

private guessTemplateInfo() : void

updateRepr()

private updateRepr() : void

        
On this page

Search results