diff --git a/src/LogLevel.php b/src/LogLevel.php index f8891ec2..b7452021 100644 --- a/src/LogLevel.php +++ b/src/LogLevel.php @@ -25,12 +25,12 @@ enum LogLevel: string { use ValuesTrait; - case EMERGENCY = PLogLevel::EMERGENCY; - case ALERT = PLogLevel::ALERT; - case CRITICAL = PLogLevel::CRITICAL; - case ERROR = PLogLevel::ERROR; - case WARNING = PLogLevel::WARNING; - case NOTICE = PLogLevel::NOTICE; - case INFO = PLogLevel::INFO; - case DEBUG = PLogLevel::DEBUG; + case EMERGENCY = 'emergency'; + case ALERT = 'alert'; + case CRITICAL = 'critical'; + case ERROR = 'error'; + case WARNING = 'warning'; + case NOTICE = 'notice'; + case INFO = 'info'; + case DEBUG = 'debug'; } \ No newline at end of file diff --git a/template/core/classes/class_response_parser.php b/template/core/classes/class_response_parser.php index 85a739b5..3f493704 100644 --- a/template/core/classes/class_response_parser.php +++ b/template/core/classes/class_response_parser.php @@ -79,6 +79,7 @@ public function getConfig(): * @param null|string|array|\stdClass|\SimpleXMLElement|\DOMDocument $input * @return null|\ + * @throws \Exception */ public function parse(null|string|array|\stdClass|\SimpleXMLElement|\DOMDocument $input): null| @@ -144,7 +145,6 @@ public function parseSimpleXMLElement(\SimpleXMLElement $input): null|getName(); - $className = ::getTypeClass($elementName); /** @var \ $fhirType */ $fhirType = ::getTypeClass($elementName); if (null === $fhirType) { @@ -189,22 +189,12 @@ public function parseObject(\stdClass|\SimpleXMLElement|\DOMDocument $input): nu * @param string $input * @return null|\ + * @throws \Exception */ public function parseXml(string $input): null| { - libxml_use_internal_errors(true); - $sxe = new \SimpleXMLElement($input, $this->config->getLibxmlOpts(); - $err = libxml_get_last_error(); - libxml_use_internal_errors(false); - if (false === $err) { - return $this->parseSimpleXMLElement($dom); - } - throw new \DomainException(sprintf( - 'Unable to parse provided input as XML. Error: %s; Input: %s', - $err ? $err->message : 'Unknown', - $this->getPrintableStringInput($input) - )); + return $this->parseSimpleXMLElement(new \SimpleXMLElement($input, $this->config->getLibxmlOpts())); } /** @@ -232,6 +222,7 @@ public function parseJson(string $input): null| + * @throws \Exception */ public function parseString(string $input): null|