Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / config / Loader / FileLoader.php
index 0dfd30ba988a8cbbb2fb036c7c643a374b599cd9..016ac4120fc9d76c8282119b3df82a3ecb117965 100644 (file)
 
 namespace Symfony\Component\Config\Loader;
 
-use Symfony\Component\Config\FileLocatorInterface;
-use Symfony\Component\Config\Exception\FileLoaderLoadException;
 use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;
+use Symfony\Component\Config\Exception\FileLoaderLoadException;
 use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
+use Symfony\Component\Config\FileLocatorInterface;
 use Symfony\Component\Config\Resource\FileExistenceResource;
 use Symfony\Component\Config\Resource\GlobResource;
 
@@ -72,7 +72,7 @@ abstract class FileLoader extends Loader
      */
     public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
     {
-        if (is_string($resource) && strlen($resource) !== $i = strcspn($resource, '*?{[')) {
+        if (\is_string($resource) && \strlen($resource) !== $i = strcspn($resource, '*?{[')) {
             $ret = array();
             $isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/');
             foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath) as $path => $info) {
@@ -95,15 +95,15 @@ abstract class FileLoader extends Loader
      */
     protected function glob($pattern, $recursive, &$resource = null, $ignoreErrors = false)
     {
-        if (strlen($pattern) === $i = strcspn($pattern, '*?{[')) {
+        if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) {
             $prefix = $pattern;
             $pattern = '';
         } elseif (0 === $i || false === strpos(substr($pattern, 0, $i), '/')) {
             $prefix = '.';
             $pattern = '/'.$pattern;
         } else {
-            $prefix = dirname(substr($pattern, 0, 1 + $i));
-            $pattern = substr($pattern, strlen($prefix));
+            $prefix = \dirname(substr($pattern, 0, 1 + $i));
+            $pattern = substr($pattern, \strlen($prefix));
         }
 
         try {
@@ -136,8 +136,8 @@ abstract class FileLoader extends Loader
                 $resource = $loader->getLocator()->locate($resource, $this->currentDir, false);
             }
 
-            $resources = is_array($resource) ? $resource : array($resource);
-            for ($i = 0; $i < $resourcesCount = count($resources); ++$i) {
+            $resources = \is_array($resource) ? $resource : array($resource);
+            for ($i = 0; $i < $resourcesCount = \count($resources); ++$i) {
                 if (isset(self::$loading[$resources[$i]])) {
                     if ($i == $resourcesCount - 1) {
                         throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));