Passed
Push — develop ( c77ba7...d3c53a )
by nguereza
04:05
created
src/Http/RateLimit/Rate.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -103,11 +103,11 @@
 block discarded – undo
103 103
         return new static($quota, 1);
104 104
     }
105 105
 
106
-     /**
107
-     * Set quota to be used per minute
108
-     * @param int $quota
109
-     * @return self
110
-     */
106
+        /**
107
+         * Set quota to be used per minute
108
+         * @param int $quota
109
+         * @return self
110
+         */
111 111
     public static function perMinute(int $quota): self
112 112
     {
113 113
         return new static($quota, 60);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class Rate
54 54
  * @package Platine\Framework\Http\RateLimit
55 55
  */
56
-class Rate
57
-{
56
+class Rate {
58 57
     /**
59 58
      * The rate limit quota
60 59
      * @var int
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
      * @param int $quota
74 73
      * @param int $interval
75 74
      */
76
-    final protected function __construct(int $quota, int $interval)
77
-    {
75
+    final protected function __construct(int $quota, int $interval) {
78 76
         if ($quota <= 0) {
79 77
             throw new InvalidArgumentException(sprintf(
80 78
                 'Quota must be greater than zero, received [%d]',
Please login to merge, or discard this patch.
src/Http/RateLimit/Exception/LimitExceededException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
40 40
  * @class LimitExceededException
41 41
  * @package Platine\Framework\Http\RateLimit\Exception
42 42
  */
43
-class LimitExceededException extends RuntimeException
44
-{
43
+class LimitExceededException extends RuntimeException {
45 44
     /**
46 45
      * The identifier
47 46
      * @var string
Please login to merge, or discard this patch.
src/Http/RateLimit/RateLimitStorageInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
  * @class RateLimitStorageInterface
52 52
  * @package Platine\Framework\Http\RateLimit
53 53
  */
54
-interface RateLimitStorageInterface
55
-{
54
+interface RateLimitStorageInterface {
56 55
     /**
57 56
      * Store the value of the given key
58 57
      * @param string $key
Please login to merge, or discard this patch.
src/Http/RateLimit/Storage/InMemoryStorage.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @class InMemoryStorage
54 54
  * @package Platine\Framework\Http\RateLimit\Storage
55 55
  */
56
-class InMemoryStorage implements RateLimitStorageInterface
57
-{
56
+class InMemoryStorage implements RateLimitStorageInterface {
58 57
     /**
59 58
      * The data store
60 59
      * @var array<string, mixed>
Please login to merge, or discard this patch.
src/Http/RateLimit/Storage/ApcuStorage.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  */
57 57
 class ApcuStorage implements RateLimitStorageInterface
58 58
 {
59
-   /**
59
+    /**
60 60
      * Create new instance
61 61
      */
62 62
     public function __construct()
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
         }
68 68
     }
69 69
 
70
-     /**
71
-     * {@inheritdoc}
72
-     */
70
+        /**
71
+         * {@inheritdoc}
72
+         */
73 73
     public function set(string $key, float $value, int $ttl): bool
74 74
     {
75 75
         return apcu_store($key, $value, $ttl);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,13 +54,11 @@
 block discarded – undo
54 54
  * @class ApcuStorage
55 55
  * @package Platine\Framework\Http\RateLimit\Storage
56 56
  */
57
-class ApcuStorage implements RateLimitStorageInterface
58
-{
57
+class ApcuStorage implements RateLimitStorageInterface {
59 58
    /**
60 59
      * Create new instance
61 60
      */
62
-    public function __construct()
63
-    {
61
+    public function __construct() {
64 62
         if ((!extension_loaded('apcu')) || !((bool) ini_get('apc.enabled'))) {
65 63
             throw new RuntimeException('The rate limit storage for APCu driver is not available.'
66 64
                             . ' Check if APCu extension is loaded and enabled.');
Please login to merge, or discard this patch.
src/Http/Exception/HttpTooManyRequestsException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
  * @class HttpTooManyRequestsException
38 38
  * @package Platine\Framework\Http\Exception
39 39
  */
40
-class HttpTooManyRequestsException extends HttpSpecialException
41
-{
40
+class HttpTooManyRequestsException extends HttpSpecialException {
42 41
     /**
43 42
      *
44 43
      * @var int
Please login to merge, or discard this patch.
src/Http/Middleware/MaintenanceMiddleware.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@
 block discarded – undo
138 138
             );
139 139
 
140 140
             $httpException->setTitle('Service Unavailable')
141
-                          ->setDescription($message)
142
-                          ->setHeaders($this->getHeaders($data));
141
+                            ->setDescription($message)
142
+                            ->setHeaders($this->getHeaders($data));
143 143
 
144 144
             throw $httpException;
145 145
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@
 block discarded – undo
71 71
  * @package Platine\Framework\Http\Middleware
72 72
  * @template T
73 73
  */
74
-class MaintenanceMiddleware implements MiddlewareInterface
75
-{
74
+class MaintenanceMiddleware implements MiddlewareInterface {
76 75
     /**
77 76
      * Create new instance
78 77
      * @param Config<T> $config
Please login to merge, or discard this patch.
src/Config/DatabaseConfigLoaderInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
  * @package Platine\Framework\Config
56 56
  * @template TDbConfigurationEntity as Entity
57 57
  */
58
-interface DatabaseConfigLoaderInterface
59
-{
58
+interface DatabaseConfigLoaderInterface {
60 59
     /**
61 60
      * Load the configuration group for the given environment with custom filters
62 61
      * @param  string $environment   the name of the environment
Please login to merge, or discard this patch.
src/Auth/Authentication/JWTAuthentication.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
         $tokenExpire = time() + $expire;
263 263
         $refreshTokenExpire = time() + $refreshExpire;
264 264
         $this->jwt->setSecret($secret)
265
-                  ->setPayload([
266
-                      'sub' => $user->id,
267
-                      'exp' => $tokenExpire,
268
-                      'permissions' => $permissions,
269
-                  ])
270
-                  ->sign();
265
+                    ->setPayload([
266
+                        'sub' => $user->id,
267
+                        'exp' => $tokenExpire,
268
+                        'permissions' => $permissions,
269
+                    ])
270
+                    ->sign();
271 271
 
272 272
         $refreshToken = Str::random(64);
273 273
         $jwtToken = $this->jwt->getToken();
@@ -282,16 +282,16 @@  discard block
 block discarded – undo
282 282
         $this->tokenRepository->save($token);
283 283
 
284 284
         $data = [
285
-          'user' => [
285
+            'user' => [
286 286
             'id' => $user->id,
287 287
             'username' => $user->username,
288 288
             'lastname' => $user->lastname,
289 289
             'firstname' => $user->firstname,
290 290
             'email' => $user->email,
291 291
             'permissions' => $permissions,
292
-          ],
293
-          'token' => $jwtToken,
294
-          'refresh_token' => $refreshToken,
292
+            ],
293
+            'token' => $jwtToken,
294
+            'refresh_token' => $refreshToken,
295 295
         ];
296 296
 
297 297
         return array_merge($data, $this->getUserData($user, $token));
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@
 block discarded – undo
72 72
  * @package Platine\Framework\Auth\Authentication
73 73
  * @template T
74 74
  */
75
-class JWTAuthentication implements ApiAuthenticationInterface
76
-{
75
+class JWTAuthentication implements ApiAuthenticationInterface {
77 76
     /**
78 77
      * Create new instance
79 78
      * @param JWT $jwt
Please login to merge, or discard this patch.