Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Sep 7, 2024
1 parent 28455dd commit f423102
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ public function getResults(): array
$count = 0;
$collectedData = [];
$isCallableWhen = is_callable($this->when);
$when = $this->when;

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

Assert::boolean($isFound);
Expand Down

0 comments on commit f423102

Please sign in to comment.