Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | protected function updateCounter(string $valueKey, string $timeKey, int $interval): int |
||
28 | { |
||
29 | $current = \apcu_inc($valueKey, 1, $success, $interval); |
||
30 | |||
31 | if ($current === 1) { |
||
32 | \apcu_store($timeKey, \time(), $interval); |
||
33 | } |
||
34 | |||
35 | return $current === false ? 1 : $current; |
||
36 | } |
||
37 | |||
43 |