Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function isRateLimitExceed() |
||
22 | { |
||
23 | $requestNum = $this->memcached->get($this->key); |
||
24 | |||
25 | // is key not exists |
||
26 | if(\Memcached::RES_NOTFOUND === $this->memcached->getResultCode()) { |
||
27 | return false; |
||
28 | } |
||
29 | |||
30 | // is requests limit reached |
||
31 | return $requestNum >= $this->requestNum; |
||
32 | } |
||
33 | |||
47 | } |