diff vendor/symfony/class-loader/Psr4ClassLoader.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
line wrap: on
line diff
--- a/vendor/symfony/class-loader/Psr4ClassLoader.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/class-loader/Psr4ClassLoader.php	Thu Feb 28 13:21:36 2019 +0000
@@ -24,7 +24,7 @@
  */
 class Psr4ClassLoader
 {
-    private $prefixes = array();
+    private $prefixes = [];
 
     /**
      * @param string $prefix
@@ -33,8 +33,8 @@
     public function addPrefix($prefix, $baseDir)
     {
         $prefix = trim($prefix, '\\').'\\';
-        $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
-        $this->prefixes[] = array($prefix, $baseDir);
+        $baseDir = rtrim($baseDir, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR;
+        $this->prefixes[] = [$prefix, $baseDir];
     }
 
     /**
@@ -48,8 +48,8 @@
 
         foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) {
             if (0 === strpos($class, $currentPrefix)) {
-                $classWithoutPrefix = substr($class, strlen($currentPrefix));
-                $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
+                $classWithoutPrefix = substr($class, \strlen($currentPrefix));
+                $file = $currentBaseDir.str_replace('\\', \DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
                 if (file_exists($file)) {
                     return $file;
                 }
@@ -81,7 +81,7 @@
      */
     public function register($prepend = false)
     {
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+        spl_autoload_register([$this, 'loadClass'], true, $prepend);
     }
 
     /**
@@ -89,6 +89,6 @@
      */
     public function unregister()
     {
-        spl_autoload_unregister(array($this, 'loadClass'));
+        spl_autoload_unregister([$this, 'loadClass']);
     }
 }