From f569833f5a44a2392723d2f1340e8a6c6f63b217 Mon Sep 17 00:00:00 2001 From: Pedro de Carvalho Date: Thu, 30 Nov 2017 15:29:30 +0000 Subject: [PATCH] move $length variable outsite foreach (#6828) the `foreach` over the `prefixDirsPsr4[$search]` won't affect `$length`. It's used for the offset of `$logicalPathPsr4`. --- src/Composer/Autoload/ClassLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index 2c72175e7..6e8d09f43 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -379,8 +379,8 @@ class ClassLoader $subPath = substr($subPath, 0, $lastPos); $search = $subPath.'\\'; if (isset($this->prefixDirsPsr4[$search])) { + $length = $this->prefixLengthsPsr4[$first][$search]; foreach ($this->prefixDirsPsr4[$search] as $dir) { - $length = $this->prefixLengthsPsr4[$first][$search]; if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; }