Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 5b56e3d

Browse files
committed
BaseClassLoader: fixed a PHPStan 1.6 error
1 parent 4c4bf5c commit 5b56e3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BaseClassLoader.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ public function findClass(string $name) : ?string{
128128
$subPath = substr($subPath, 0, $lastPos);
129129
$search = $subPath . '\\';
130130

131-
if(isset($this->psr4Lookup[$search])){
131+
/** @var \Threaded|null $lookup */
132+
$lookup = $this->psr4Lookup[$search] ?? null;
133+
if($lookup !== null){
132134
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
133-
foreach($this->psr4Lookup[$search] as $dir){
135+
foreach($lookup as $dir){
134136
if(file_exists($file = $dir . $pathEnd)){
135137
return $file;
136138
}

0 commit comments

Comments
 (0)