Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Error.php

function Error::__construct

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php \PhpParser\Node\Expr\Error::__construct()
  2. 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\Error

Code

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();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal