Passed
Pull Request — master (#280)
by MusikAnimal
11:18
created
src/AppBundle/EventSubscriber/RateLimitSubscriber.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * This file contains only the RateLimitSubscriber class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace AppBundle\EventSubscriber;
9 9
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function onKernelController(FilterControllerEvent $event): void
65 65
     {
66
-        $this->rateLimit = (int) $this->container->getParameter('app.rate_limit_count');
67
-        $this->rateDuration = (int) $this->container->getParameter('app.rate_limit_time');
66
+        $this->rateLimit = (int)$this->container->getParameter('app.rate_limit_count');
67
+        $this->rateDuration = (int)$this->container->getParameter('app.rate_limit_time');
68 68
         $request = $event->getRequest();
69 69
 
70 70
         $this->checkBlacklist($request);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         }
76 76
 
77 77
         $controller = $event->getController();
78
-        $loggedIn = (bool) $this->container->get('session')->get('logged_in_user');
78
+        $loggedIn = (bool)$this->container->get('session')->get('logged_in_user');
79 79
 
80 80
         /**
81 81
          * Rate limiting will not apply to these actions
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $cacheItem = $cache->getItem($cacheKey);
100 100
 
101 101
         // If increment value already in cache, or start with 1.
102
-        $count = $cacheItem->isHit() ? (int) $cacheItem->get() + 1 : 1;
102
+        $count = $cacheItem->isHit() ? (int)$cacheItem->get()+1 : 1;
103 103
 
104 104
         // Check if limit has been exceeded, and if so, throw an error.
105 105
         if ($count > $this->rateLimit) {
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
         $message = $this->i18n->msg('error-rate-limit', [
178 178
             $this->rateDuration,
179 179
             "<a href='/login'>".$this->i18n->msg('error-rate-limit-login')."</a>",
180
-            "<a href='https://xtools.readthedocs.io/en/stable/api' target='_blank'>" .
181
-                $this->i18n->msg('api') .
180
+            "<a href='https://xtools.readthedocs.io/en/stable/api' target='_blank'>".
181
+                $this->i18n->msg('api').
182 182
             "</a>",
183 183
         ]);
184 184
 
Please login to merge, or discard this patch.