Skip to content

Commit

Permalink
refactor: fix PHPStan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 18, 2023
1 parent 8003927 commit 03290ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@
];
$ignoreErrors[] = [
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
'count' => 2,
'count' => 1,
'path' => __DIR__ . '/system/Filters/Filters.php',
];
$ignoreErrors[] = [
Expand Down
10 changes: 5 additions & 5 deletions system/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function setResponse(ResponseInterface $response)
* uri and position.
*
* @param string $uri URI path relative to baseURL
* @phpstan-param 'before'|'after' $position
*
* @return RequestInterface|ResponseInterface|string|null
*
Expand All @@ -188,11 +189,8 @@ public function run(string $uri, string $position = 'before')
return $result;
}

if ($position === 'after') {
$result = $this->runAfter($this->filtersClass[$position]);
}

return $result;
// After
return $this->runAfter($this->filtersClass[$position]);
}

/**
Expand Down Expand Up @@ -266,6 +264,8 @@ private function runAfter(array $filterClasses): ResponseInterface
*
* @return RequestInterface|ResponseInterface|string|null
*
* @phpstan-param 'before'|'after' $position
*
* @throws FilterException
*/
public function runRequired(string $position = 'before')
Expand Down

0 comments on commit 03290ab

Please sign in to comment.