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

Breadcrumb

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

function ParseException::updateRepr

4 calls to ParseException::updateRepr()
ParseException::setParsedFile in vendor/symfony/yaml/Exception/ParseException.php
Sets the filename where the error occurred.
ParseException::setParsedLine in vendor/symfony/yaml/Exception/ParseException.php
Sets the line where the error occurred.
ParseException::setSnippet in vendor/symfony/yaml/Exception/ParseException.php
Sets the snippet of code near the error.
ParseException::__construct in vendor/symfony/yaml/Exception/ParseException.php

File

vendor/symfony/yaml/Exception/ParseException.php, line 95

Class

ParseException
Exception class thrown when an error occurs during parsing.

Namespace

Symfony\Component\Yaml\Exception

Code

private function updateRepr() : void {
    $this->message = $this->rawMessage;
    $dot = false;
    if (str_ends_with($this->message, '.')) {
        $this->message = substr($this->message, 0, -1);
        $dot = true;
    }
    if (null !== $this->parsedFile) {
        $this->message .= \sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
    }
    if ($this->parsedLine >= 0) {
        $this->message .= \sprintf(' at line %d', $this->parsedLine);
    }
    if ($this->snippet) {
        $this->message .= \sprintf(' (near "%s")', $this->snippet);
    }
    if ($dot) {
        $this->message .= '.';
    }
}

API Navigation

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