Skip to content

Commit 848d58f

Browse files
authored
Fix the case where the stubs path dir does not exist (#215)
1 parent 976b10f commit 848d58f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ public function __invoke(RegistrationInterface $api, SimpleXMLElement $config =
103103

104104
private function addStubs(RegistrationInterface $api, string $path): void
105105
{
106+
if (!is_dir($path)) {
107+
// e.g. looking for stubs for version 3, but there aren't any at time of writing, so don't try and load them.
108+
return;
109+
}
110+
106111
$a = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
107112
foreach ($a as $file) {
108113
if (!$file->isDir()) {

0 commit comments

Comments
 (0)