@@ -57,7 +57,7 @@ |
||
57 | 57 | { |
58 | 58 | $item = $this->cacheItemPool->getItem($this->deriveCacheKey($request)); |
59 | 59 | |
60 | - if($requestCount = $item->get()) { |
|
60 | + if ($requestCount = $item->get()) { |
|
61 | 61 | $item->set($requestCount + 1); |
62 | 62 | } else { |
63 | 63 | $item->set(1)->expiresAfter($this->perXSeconds); |
@@ -9,8 +9,7 @@ discard block |
||
9 | 9 | * Class CachePoolThrottle |
10 | 10 | * @package LunixREST\Throttle |
11 | 11 | */ |
12 | -abstract class CachePoolThrottle implements Throttle |
|
13 | -{ |
|
12 | +abstract class CachePoolThrottle implements Throttle { |
|
14 | 13 | /** |
15 | 14 | * @var CacheItemPoolInterface |
16 | 15 | */ |
@@ -30,8 +29,7 @@ discard block |
||
30 | 29 | * @param int $limit |
31 | 30 | * @param int $perXSeconds |
32 | 31 | */ |
33 | - public function __construct(CacheItemPoolInterface $cacheItemPool, int $limit = 60, int $perXSeconds = 60) |
|
34 | - { |
|
32 | + public function __construct(CacheItemPoolInterface $cacheItemPool, int $limit = 60, int $perXSeconds = 60) { |
|
35 | 33 | $this->cacheItemPool = $cacheItemPool; |
36 | 34 | $this->limit = $limit; |
37 | 35 | $this->perXSeconds = $perXSeconds; |
@@ -53,8 +51,7 @@ discard block |
||
53 | 51 | * Log that a request took place |
54 | 52 | * @param \LunixREST\APIRequest\APIRequest $request |
55 | 53 | */ |
56 | - public function logRequest(APIRequest $request) |
|
57 | - { |
|
54 | + public function logRequest(APIRequest $request) { |
|
58 | 55 | $item = $this->cacheItemPool->getItem($this->deriveCacheKey($request)); |
59 | 56 | |
60 | 57 | if($requestCount = $item->get()) { |