Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 28, 2024
1 parent 3e18640 commit 94f1a87
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ public function getResults(): array

$count = 0;
$collectedData = [];
$isCallableWhen = is_callable($this->when);

if ($isCallableWhen) {
if (is_callable($this->when)) {
// filter must be a callable with bool return type
Filter::boolean($this->when);
}

foreach ($this->data as $key => $datum) {
if ($isCallableWhen) {
if ($this->when !== null) {
/**
* @var callable(mixed $datum, int|string|null $key): bool $when
*/
Expand Down

0 comments on commit 94f1a87

Please sign in to comment.