| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 10 | public function hit(Key $key): Counter |
|
| 24 | { |
||
| 25 | 10 | $item = $this->getNormalizedItem($key); |
|
| 26 | |||
| 27 | /** @var Counter $counter */ |
||
| 28 | 10 | $counter = $item->get()->addHit(); |
|
| 29 | |||
| 30 | 10 | $item->set($counter); |
|
| 31 | 10 | $item->expiresAfter($counter->resetsIn()); |
|
| 32 | 10 | $this->cache->save($item); |
|
| 33 | |||
| 34 | 10 | return $counter; |
|
| 35 | } |
||
| 58 |