diff vendor/symfony/routing/Loader/XmlFileLoader.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children af1871eacc83
line wrap: on
line diff
--- a/vendor/symfony/routing/Loader/XmlFileLoader.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/routing/Loader/XmlFileLoader.php	Thu Feb 28 13:21:36 2019 +0000
@@ -11,11 +11,11 @@
 
 namespace Symfony\Component\Routing\Loader;
 
+use Symfony\Component\Config\Loader\FileLoader;
+use Symfony\Component\Config\Resource\FileResource;
+use Symfony\Component\Config\Util\XmlUtils;
+use Symfony\Component\Routing\Route;
 use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Route;
-use Symfony\Component\Config\Resource\FileResource;
-use Symfony\Component\Config\Loader\FileLoader;
-use Symfony\Component\Config\Util\XmlUtils;
 
 /**
  * XmlFileLoader loads XML routing files.
@@ -93,7 +93,7 @@
      */
     public function supports($resource, $type = null)
     {
-        return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'xml' === $type);
+        return \is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'xml' === $type);
     }
 
     /**
@@ -144,12 +144,12 @@
 
         list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
 
-        $this->setCurrentDir(dirname($path));
+        $this->setCurrentDir(\dirname($path));
 
         $imported = $this->import($resource, ('' !== $type ? $type : null), false, $file);
 
-        if (!is_array($imported)) {
-            $imported = array($imported);
+        if (!\is_array($imported)) {
+            $imported = [$imported];
         }
 
         foreach ($imported as $subCollection) {
@@ -203,9 +203,9 @@
      */
     private function parseConfigs(\DOMElement $node, $path)
     {
-        $defaults = array();
-        $requirements = array();
-        $options = array();
+        $defaults = [];
+        $requirements = [];
+        $options = [];
         $condition = null;
 
         foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) {
@@ -246,7 +246,7 @@
             $defaults['_controller'] = $controller;
         }
 
-        return array($defaults, $requirements, $options, $condition);
+        return [$defaults, $requirements, $options, $condition];
     }
 
     /**
@@ -310,7 +310,7 @@
             case 'string':
                 return trim($node->nodeValue);
             case 'list':
-                $list = array();
+                $list = [];
 
                 foreach ($node->childNodes as $element) {
                     if (!$element instanceof \DOMElement) {
@@ -326,7 +326,7 @@
 
                 return $list;
             case 'map':
-                $map = array();
+                $map = [];
 
                 foreach ($node->childNodes as $element) {
                     if (!$element instanceof \DOMElement) {