function Error::__construct
Same name in this branch
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php \PhpParser\Node\Expr\Error::__construct()
- 11.1.x vendor/nikic/php-parser/lib/PhpParser/Error.php \PhpParser\Error::__construct()
Constructor.
By default, automatic guessing is enabled.
Parameters
string $message The error message:
int $lineno The template line where the error occurred:
Source|null $source The source context where the error occurred:
File
-
vendor/
twig/ twig/ src/ Error/ Error.php, line 56
Class
- Error
- Twig base exception.
Namespace
Twig\ErrorCode
public function __construct(string $message, int $lineno = -1, ?Source $source = null, ?\Throwable $previous = null) {
parent::__construct('', 0, $previous);
if (null === $source) {
$name = null;
}
else {
$name = $source->getName();
$this->sourceCode = $source->getCode();
$this->sourcePath = $source->getPath();
}
$this->lineno = $lineno;
$this->name = $name;
$this->rawMessage = $message;
$this->updateRepr();
}