level, $xmlerror->code, trim( $xmlerror->message ) ); } libxml_clear_errors(); throw new XmlMarkupParseErrorException(); } return $xml; } protected static function logXmlParseError( $level, $code, $message ) { WikiaLogger::instance()->info( "PortableInfobox XML Parser problem", [ "level" => $level, "code" => $code, "message" => $message ] ); } } class XmlMarkupParseErrorException extends \Exception { }