From ecb9ad9c46d2d30bc27069dda28363c60e6a40c2 Mon Sep 17 00:00:00 2001 From: catch <catch56@gmail.com> Date: Wed, 26 Oct 2022 08:23:29 +0100 Subject: [PATCH] Issue #3317223 by mondrake, longwave: Fix RecursiveExtensionFilterIterator PHPStan L0 issues (cherry picked from commit 23b444af40c00a74718bab632c84a8e9c4dd2bcf) --- .../Extension/Discovery/RecursiveExtensionFilterIterator.php | 2 +- core/phpstan-baseline.neon | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php index b61ff4867961..62b241ca7af6 100644 --- a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php +++ b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php @@ -136,7 +136,7 @@ public function accept() { if ($name[0] == '.') { return FALSE; } - if ($this->isDir()) { + if ($this->current()->isDir()) { // If this is a subdirectory of a base search path, only recurse into the // fixed list of expected extension type directory names. Required for // scanning the top-level/root directory; without this condition, we would diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index bc417f5fd362..789c919edb95 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -245,11 +245,6 @@ parameters: count: 2 path: lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php - - - message: "#^Call to an undefined method Drupal\\\\Core\\\\Extension\\\\Discovery\\\\RecursiveExtensionFilterIterator\\:\\:isDir\\(\\)\\.$#" - count: 1 - path: lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php - - message: "#^Method Drupal\\\\Core\\\\Field\\\\FieldItemBase\\:\\:generateSampleValue\\(\\) should return array but return statement is missing\\.$#" count: 1 -- GitLab