From bceaa7e50ee43ec308f62555a9959567fab19cc4 Mon Sep 17 00:00:00 2001 From: Maxence Winandy Date: Thu, 3 Sep 2015 12:17:43 +0200 Subject: [PATCH] Path fix for Exception (prevent conflicts with symfony) --- src/Array2XML.php | 6 +++--- src/XML2Array.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Array2XML.php b/src/Array2XML.php index 256b65e1..eaf439c3 100644 --- a/src/Array2XML.php +++ b/src/Array2XML.php @@ -1,7 +1,7 @@ $value) { if (!self::isValidTagName($key)) { - throw new Exception('[Array2XML] Illegal character in attribute name. attribute: ' . $key . ' in node: ' . $node_name); + throw new \Exception('[Array2XML] Illegal character in attribute name. attribute: ' . $key . ' in node: ' . $node_name); } $node->setAttribute($key, self::bool2str($value)); } @@ -137,7 +137,7 @@ private static function convert($node_name, $arr = array()) // recurse to get the node for that key foreach ($arr as $key => $value) { if (!self::isValidTagName($key)) { - throw new Exception('[Array2XML] Illegal character in tag name. tag: ' . $key . ' in node: ' . $node_name); + throw new \Exception('[Array2XML] Illegal character in tag name. tag: ' . $key . ' in node: ' . $node_name); } if (is_array($value) && is_numeric(key($value))) { // MORE THAN ONE NODE OF ITS KIND; diff --git a/src/XML2Array.php b/src/XML2Array.php index 537ca73a..d18118f7 100644 --- a/src/XML2Array.php +++ b/src/XML2Array.php @@ -1,8 +1,8 @@ loadXML($input_xml); if (!$parsed) { - throw new Exception('[XML2Array] Error parsing the XML string.'); + throw new \Exception('[XML2Array] Error parsing the XML string.'); } } else { if (get_class($input_xml) != 'DOMDocument') { - throw new Exception('[XML2Array] The input XML object should be of type: DOMDocument.'); + throw new \Exception('[XML2Array] The input XML object should be of type: DOMDocument.'); } $xml = self::$xml = $input_xml; }