Skip to content

Commit 59ca2c8

Browse files
authored
Fix type in ConcurrentRunner (#174)
1 parent bf37527 commit 59ca2c8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

benchmarks/Support/ConcurrentRunner.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,19 @@ protected function saveOperations(string $method, int $operations, string $nonce
2929
}
3030

3131
/**
32-
* @return array<int, int>
32+
* @return list<array{int, int, int, int}>
3333
*/
3434
protected function loadOperations(string $method, string $nonce): array
3535
{
36-
$result = [];
37-
38-
foreach ($this->redis->smembers("benchmark_run:{$this->run_id}:{$method}:{$nonce}") as $iteration) {
39-
$result[] = unserialize($iteration);
40-
}
41-
42-
/** @var array<int, int> $result */
43-
return $result;
36+
return array_values(array_map(
37+
static function (string $iteration): array {
38+
/** @var array{int, int, int, int} $measurements */
39+
$measurements = unserialize($iteration);
40+
41+
return $measurements;
42+
},
43+
$this->redis->smembers("benchmark_run:{$this->run_id}:{$method}:{$nonce}")
44+
));
4445
}
4546

4647
protected function blockForWorkers(string $nonce, float $timeout = 1.0): void

0 commit comments

Comments
 (0)