protected function Twig_Error::updateRepr

3 calls to Twig_Error::updateRepr()
Twig_Error::setTemplateFile in drupal/core/vendor/twig/twig/lib/Twig/Error.php
Sets the filename where the error occurred.
Twig_Error::setTemplateLine in drupal/core/vendor/twig/twig/lib/Twig/Error.php
Sets the template line where the error occurred.
Twig_Error::__construct in drupal/core/vendor/twig/twig/lib/Twig/Error.php
Constructor.

File

drupal/core/vendor/twig/twig/lib/Twig/Error.php, line 125

Class

Twig_Error
Twig base exception.

Code

protected function updateRepr() {
  $this->message = $this->rawMessage;
  $dot = false;
  if ('.' === substr($this->message, -1)) {
    $this->message = substr($this->message, 0, -1);
    $dot = true;
  }
  if (null !== $this->filename) {
    if (is_string($this->filename) || is_object($this->filename) && method_exists($this->filename, '__toString')) {
      $filename = sprintf('"%s"', $this->filename);
    }
    else {
      $filename = json_encode($this->filename);
    }
    $this->message .= sprintf(' in %s', $filename);
  }
  if ($this->lineno >= 0) {
    $this->message .= sprintf(' at line %d', $this->lineno);
  }
  if ($dot) {
    $this->message .= '.';
  }
}