Esempio n. 1
0
 /**
  * @param ParseException $exception
  *
  * @return YamlLintError
  */
 public static function fromParseException(ParseException $exception)
 {
     return new YamlLintError(LintError::TYPE_ERROR, $exception->getMessage(), $exception->getParsedFile(), $exception->getParsedLine(), $exception->getSnippet());
 }
Esempio n. 2
0
 /**
  * Casts Symfony's Yaml ParseException to ours.
  *
  * @param YamlParseException $exception
  *
  * @return ParseException
  */
 public static function castFromYaml(YamlParseException $exception)
 {
     $message = static::parseRawMessage($exception->getMessage());
     return new static($message, $exception->getParsedLine(), $exception->getSnippet(), $exception);
 }