| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function collect() |
||
| 35 | { |
||
| 36 | $newValue = $this->memcached->increment($this->key); |
||
| 37 | if(false !== $newValue) { |
||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | if(\Memcached::RES_NOTFOUND !== $this->memcached->getResultCode()) { |
||
| 42 | throw new \Exception('Error collecting value'); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->memcached->set($this->key, 1, time() + $this->timeInterval); |
||
| 46 | } |
||
| 47 | } |