Conditions | 2 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public function getNbUsers(): PromiseInterface |
||
42 | { |
||
43 | /** @phpstan-ignore-next-line */ |
||
44 | return $this->client->keys('users:*') |
||
45 | ->then( |
||
46 | function (array $keys) { |
||
47 | $promises = []; |
||
48 | foreach ($keys as $key) { |
||
49 | $promises[] = $this->client->get($key); /** @phpstan-ignore-line */ |
||
50 | } |
||
51 | |||
52 | return all($promises)->then(fn (array $results): int => \array_sum($results)); |
||
53 | } |
||
57 |