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