We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class TotalCountCache implements ResetInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var int|callable |
||
13 | */ |
||
14 | private $total; |
||
15 | private int $totalCount; |
||
16 | |||
17 | /** |
||
18 | * @param int|callable $total |
||
19 | */ |
||
20 | public function __construct($total) |
||
23 | } |
||
24 | |||
25 | public function __invoke(array $callableArgs = []): int |
||
26 | { |
||
27 | if (isset($this->totalCount)) { |
||
28 | return $this->totalCount; |
||
29 | } |
||
30 | |||
31 | $this->totalCount = is_callable($this->total) ? call_user_func_array($this->total, $callableArgs) : $this->total; |
||
|
|||
32 | |||
33 | return $this->totalCount; |
||
34 | } |
||
35 | |||
36 | public function reset(): void |
||
39 | } |
||
40 | } |
||
41 |