| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function updateCounter(string $valueKey, string $timeKey, int $interval): int |
||
| 31 | { |
||
| 32 | $current = $this->memcached->increment($valueKey, 1, 1, $interval); |
||
| 33 | |||
| 34 | if ($current === 1) { |
||
| 35 | $this->memcached->add($timeKey, \time(), $interval); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $current === false ? 1 : $current; |
||
| 39 | } |
||
| 40 | |||
| 46 |