Skip to content

Commit

Permalink
fix: ErrorException : Undefined variable $filterClasses
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 12, 2023
1 parent 064b8b0 commit 012cf3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/Test/FilterTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ 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) {
if (! isset($this->filtersConfig->aliases[$filter])) {
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) {
Expand Down

0 comments on commit 012cf3b

Please sign in to comment.