You are here

private function ParseException::updateRepr in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php \Symfony\Component\Yaml\Exception\ParseException::updateRepr()
4 calls to ParseException::updateRepr()
ParseException::setParsedFile in modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php
Sets the filename where the error occurred.
ParseException::setParsedLine in modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php
Sets the line where the error occurred.
ParseException::setSnippet in modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php
Sets the snippet of code near the error.
ParseException::__construct in modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php
Constructor.

File

modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Exception/ParseException.php, line 117

Class

ParseException
Exception class thrown when an error occurs during parsing.

Namespace

Symfony\Component\Yaml\Exception

Code

private 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->parsedFile) {
    if (PHP_VERSION_ID >= 50400) {
      $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
    }
    else {
      $jsonOptions = 0;
    }
    $this->message .= sprintf(' in %s', json_encode($this->parsedFile, $jsonOptions));
  }
  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 .= '.';
  }
}