From 012cf3b8d42bb7528a7ee2faecdc7d9fef82b884 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 12 Nov 2023 17:33:01 +0900 Subject: [PATCH] fix: ErrorException : Undefined variable $filterClasses --- system/Test/FilterTestTrait.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/Test/FilterTestTrait.php b/system/Test/FilterTestTrait.php index 084a6cd082fc..9a75fcf838c0 100644 --- a/system/Test/FilterTestTrait.php +++ b/system/Test/FilterTestTrait.php @@ -125,6 +125,8 @@ protected function getFilterCaller($filter, string $position): Closure throw new InvalidArgumentException('Invalid filter position passed: ' . $position); } + $filterClasses = [$filter]; + if (is_string($filter)) { // Check for an alias (no namespace) if (strpos($filter, '\\') === false) { @@ -132,10 +134,8 @@ protected function getFilterCaller($filter, string $position): Closure throw new RuntimeException("No filter found with alias '{$filter}'"); } - $filterClasses = $this->filtersConfig->aliases[$filter]; + $filterClasses = (array) $this->filtersConfig->aliases[$filter]; } - - $filterClasses = (array) $filterClasses; } foreach ($filterClasses as $class) {