We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d675556 + 9c049f7 commit 8acaa1eCopy full SHA for 8acaa1e
src/Drupal/ExtensionDiscovery.php
@@ -377,9 +377,11 @@ protected function scanDirectory($dir): array
377
$type = false;
378
$file = $fileinfo->openFile('r');
379
while (!$type && !$file->eof()) {
380
- preg_match('@^type:\s*(\'|")?(\w+)\1?\s*$@', $file->fgets(), $matches);
381
- if (isset($matches[2])) {
382
- $type = $matches[2];
+ if ($line = $file->fgets()) {
+ preg_match('@^type:\s*(\'|")?(\w+)\1?\s*$@', $line, $matches);
+ if (isset($matches[2])) {
383
+ $type = $matches[2];
384
+ }
385
}
386
387
if ($type === false) {
0 commit comments