From 23b444af40c00a74718bab632c84a8e9c4dd2bcf 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

---
 .../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 1c8358a39dbc..cdd1ca5e49d3 100644
--- a/core/phpstan-baseline.neon
+++ b/core/phpstan-baseline.neon
@@ -235,11 +235,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