getData($path))) { // XML appears to be valid. return; } foreach (libxml_get_errors() as $error) { $message = new ArcanistLintMessage(); $message->setPath($path); $message->setLine($error->line); $message->setChar($error->column ? $error->column : null); $message->setCode($this->getLintMessageFullCode($error->code)); $message->setName('LibXML Error'); $message->setDescription(trim($error->message)); switch ($error->level) { case LIBXML_ERR_NONE: $message->setSeverity(ArcanistLintSeverity::SEVERITY_DISABLED); break; case LIBXML_ERR_WARNING: $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); break; case LIBXML_ERR_ERROR: case LIBXML_ERR_FATAL: $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); break; default: $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); break; } $this->addLintMessage($message); } } }