Skip to content

Commit 191feb6

Browse files
committed
ensures that $this->classes & $this->missing are not null
1 parent dec3ba0 commit 191feb6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/RobotLoader/RobotLoader.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ public function setTempDirectory(string $dir): self
411411
private function loadCache(): void
412412
{
413413
$file = $this->getCacheFile();
414-
[$this->classes, $this->missing] = @include $file; // @ file may not exist
415-
if (is_array($this->classes)) {
414+
$data = @include $file; // @ file may not exist
415+
if (is_array($data)) {
416+
[$this->classes, $this->missing] = $data;
416417
return;
417418
}
418419

@@ -421,8 +422,10 @@ private function loadCache(): void
421422
throw new \RuntimeException("Unable to create or acquire exclusive lock on file '$file.lock'.");
422423
}
423424

424-
[$this->classes, $this->missing] = @include $file; // @ file may not exist
425-
if (!is_array($this->classes)) {
425+
$data = @include $file; // @ file may not exist
426+
if (is_array($data)) {
427+
[$this->classes, $this->missing] = $data;
428+
} else {
426429
$this->rebuild();
427430
}
428431

0 commit comments

Comments
 (0)