Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / config / Util / XmlUtils.php
index e1c4a4ad3f01e97a3a51a2a3c1b2898687e23945..8ad58d61e6ab4312592600aca2bf11cc25250a30 100644 (file)
@@ -46,7 +46,7 @@ class XmlUtils
      */
     public static function parse($content, $schemaOrCallable = null)
     {
-        if (!extension_loaded('dom')) {
+        if (!\extension_loaded('dom')) {
             throw new \RuntimeException('Extension DOM is required.');
         }
 
@@ -56,7 +56,7 @@ class XmlUtils
 
         $dom = new \DOMDocument();
         $dom->validateOnParse = true;
-        if (!$dom->loadXML($content, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
+        if (!$dom->loadXML($content, LIBXML_NONET | (\defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
             libxml_disable_entity_loader($disableEntities);
 
             throw new XmlParsingException(implode("\n", static::getXmlErrors($internalErrors)));
@@ -78,13 +78,13 @@ class XmlUtils
             libxml_clear_errors();
 
             $e = null;
-            if (is_callable($schemaOrCallable)) {
+            if (\is_callable($schemaOrCallable)) {
                 try {
-                    $valid = call_user_func($schemaOrCallable, $dom, $internalErrors);
+                    $valid = \call_user_func($schemaOrCallable, $dom, $internalErrors);
                 } catch (\Exception $e) {
                     $valid = false;
                 }
-            } elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) {
+            } elseif (!\is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) {
                 $schemaSource = file_get_contents((string) $schemaOrCallable);
                 $valid = @$dom->schemaValidateSource($schemaSource);
             } else {
@@ -160,7 +160,7 @@ class XmlUtils
         $empty = true;
         $config = array();
         foreach ($element->attributes as $name => $node) {
-            if ($checkPrefix && !in_array((string) $node->prefix, array('', $prefix), true)) {
+            if ($checkPrefix && !\in_array((string) $node->prefix, array('', $prefix), true)) {
                 continue;
             }
             $config[$name] = static::phpize($node->value);
@@ -181,7 +181,7 @@ class XmlUtils
 
                 $key = $node->localName;
                 if (isset($config[$key])) {
-                    if (!is_array($config[$key]) || !is_int(key($config[$key]))) {
+                    if (!\is_array($config[$key]) || !\is_int(key($config[$key]))) {
                         $config[$key] = array($config[$key]);
                     }
                     $config[$key][] = $value;
@@ -195,7 +195,7 @@ class XmlUtils
 
         if (false !== $nodeValue) {
             $value = static::phpize($nodeValue);
-            if (count($config)) {
+            if (\count($config)) {
                 $config['value'] = $value;
             } else {
                 $config = $value;
@@ -240,7 +240,7 @@ class XmlUtils
                 return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
             case preg_match('/^0x[0-9a-f]++$/i', $value):
                 return hexdec($value);
-            case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value):
+            case preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value):
                 return (float) $value;
             default:
                 return $value;