Completed
Push — master ( c077e9...4fc007 )
by John
02:06
created
src/Throttle/CachePoolThrottle.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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()) {
Please login to merge, or discard this patch.