move $length variable outsite foreach (#6828)
the `foreach` over the `prefixDirsPsr4[$search]` won't affect `$length`. It's used for the offset of `$logicalPathPsr4`.pull/6783/head
parent
a4b220273e
commit
f569833f5a
|
@ -379,8 +379,8 @@ class ClassLoader
|
||||||
$subPath = substr($subPath, 0, $lastPos);
|
$subPath = substr($subPath, 0, $lastPos);
|
||||||
$search = $subPath.'\\';
|
$search = $subPath.'\\';
|
||||||
if (isset($this->prefixDirsPsr4[$search])) {
|
if (isset($this->prefixDirsPsr4[$search])) {
|
||||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
|
||||||
$length = $this->prefixLengthsPsr4[$first][$search];
|
$length = $this->prefixLengthsPsr4[$first][$search];
|
||||||
|
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue