Passed
Push — master ( e67140...8ac87e )
by Vince
01:52
created
src/core/keys/key.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function apiKeyGenerate($length = 32)
37 37
     {
38
-        $randInt = microtime().rand(1000, 9999);
38
+        $randInt = microtime() . rand(1000, 9999);
39 39
         $messageDigest = md5($randInt);
40 40
         return implode(
41 41
             '-',
Please login to merge, or discard this patch.
src/core/throttle/tokenBucket.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@
 block discarded – undo
215 215
                 if ($nLeakRate < 0) {
216 216
                     $nLeakRate = 0;
217 217
                 }
218
-                $this->leakage = (float)$nLeakRate;
218
+                $this->leakage = (float) $nLeakRate;
219 219
             }
220 220
         }
221 221
 
Please login to merge, or discard this patch.
src/core/throttle/limiterOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
 
139 139
         if (is_numeric($timeframe)) {
140 140
             if ($timeframe < 0) {
141
-                $timeframe = ($timeframe*-1);
141
+                $timeframe = ($timeframe * -1);
142 142
             }
143 143
             self::$timeframe['CUSTOM'] = $timeframe;
144 144
             $this->window = intval(self::$timeframe['CUSTOM']);
Please login to merge, or discard this patch.
src/core/auth/jwtValidate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      */
67 67
     public static function payload(array $payloadObject = [])
68 68
     {
69
-        if( self::isAnonymousScope($payloadObject) ) {
69
+        if (self::isAnonymousScope($payloadObject)) {
70 70
             return true;
71 71
         }
72 72
 
Please login to merge, or discard this patch.
src/core/throttle/limiter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $bucket->getTokenData()
212 212
         );
213 213
 
214
-        if($this->isMockTest) {
214
+        if ($this->isMockTest) {
215 215
             return;
216 216
         }
217 217
         
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     public function getAccount()
259 259
     {
260
-        if($this->isMockTest) {
260
+        if ($this->isMockTest) {
261 261
             $this->getMockAccount();
262 262
         }
263 263
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
         $mockAccount = [];
283 283
 
284
-        if(!isset($mockAccount['bucket'])) {
284
+        if (!isset($mockAccount['bucket'])) {
285 285
             $mockAccount['bucket'] = $packer->pack(
286 286
                 $bucket->getTokenData()
287 287
             );
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 
290 290
         $mockAccount['access'] = time();
291 291
 
292
-        $this->setAccount((object)$mockAccount);
293
-        $this->mockAccount = (object)$mockAccount;
292
+        $this->setAccount((object) $mockAccount);
293
+        $this->mockAccount = (object) $mockAccount;
294 294
     }
295 295
 
296 296
     /**
Please login to merge, or discard this patch.
src/core/auth/jwtDecoder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $payloadObject = $cipher->jsonDecode($cipher->decode($jwtPayload));
52 52
 
53 53
         // @codeCoverageIgnoreStart
54
-        if( $this->key == 'payloadOnly' ) {
54
+        if ($this->key == 'payloadOnly') {
55 55
             return $payloadObject;
56 56
         }
57 57
         // @codeCoverageIgnoreEnd
Please login to merge, or discard this patch.
src/core/auth/jwt.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      * @var array
53 53
      */
54 54
     protected static $ALGORITHMS = [
55
-        'HS256','sha256',
56
-        'HS384','sha384',
57
-        'HS512','sha512',
55
+        'HS256', 'sha256',
56
+        'HS384', 'sha384',
57
+        'HS512', 'sha512',
58 58
     ];
59 59
 
60 60
     /**
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      * [getOptions]
253 253
      * @return array
254 254
      */
255
-    public function getOptions():?array
255
+    public function getOptions(): ?array
256 256
     {
257 257
         return self::$options;
258 258
     }
Please login to merge, or discard this patch.
src/core/headers/headerVerbs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,8 +156,8 @@
 block discarded – undo
156 156
     public static function getRequestVerb():string
157 157
     {
158 158
         $helper = new helper;
159
-        $method = $helper->checkVal(@$_SERVER, 'REQUEST_METHOD', '' );
160
-        $method = $helper->checkVal(@$_SERVER, 'HTTP_X_HTTP_METHOD', $method );
159
+        $method = $helper->checkVal(@$_SERVER, 'REQUEST_METHOD', '');
160
+        $method = $helper->checkVal(@$_SERVER, 'HTTP_X_HTTP_METHOD', $method);
161 161
 
162 162
         return strtolower($method);
163 163
     }
Please login to merge, or discard this patch.
src/core/endpoints/map.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
         /**
77 77
          * Check if a custom directory was set in the Responsible API options
78 78
          */
79
-        if( (isset($options['classRoute']) && !empty($options['classRoute'])) && 
79
+        if ((isset($options['classRoute']) && !empty($options['classRoute'])) && 
80 80
             (isset($options['classRoute']['directory']) && isset($options['classRoute']['namespace']))
81 81
         ) {
82 82
             $customService = $this->options['classRoute'];
83 83
             $directory = $customService['directory'];
84 84
             $middleware = $customService['namespace'];
85 85
 
86
-        }else {
86
+        } else {
87 87
             $middleware = 'responsible';
88 88
 
89 89
             $endpoint = str_replace(
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 if (class_exists($child) && method_exists($child, 'register')) {
142 142
                     self::$middleWareClass = new $child;
143 143
                     $this->registry[$point] = self::$middleWareClass->register();
144
-                }else{
144
+                } else {
145 145
                     (new exception\errorException)
146 146
                         ->setOptions($this->getOptions())
147 147
                         ->message("Class Error:: class {$child} needs to exist. See documentation on setting up a service.")
@@ -232,16 +232,16 @@  discard block
 block discarded – undo
232 232
                  * @var array
233 233
                  */
234 234
                 if (array_search($endpoint, $this->registry[$api]) !== false) {
235
-                    if( method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope') ) {
235
+                    if (method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope')) {
236 236
                         $classScope = (new $this->NAMESPACE_ENDPOINTS[$api])->scope();
237 237
                         $position = array_search($endpoint, $this->registry[$api]);
238 238
                         
239
-                        if( is_array($classScope) && isset($classScope[$position]) ) {
239
+                        if (is_array($classScope) && isset($classScope[$position])) {
240 240
                             $endpointSettings['model']['scope'] = $classScope[$position];
241 241
 
242
-                        }else{
242
+                        } else {
243 243
 
244
-                            if( !is_array($classScope) ) {
244
+                            if (!is_array($classScope)) {
245 245
                                 $endpointSettings['model']['scope'] = $classScope;
246 246
                             }
247 247
                         }
@@ -292,16 +292,16 @@  discard block
 block discarded – undo
292 292
 
293 293
                         $scope = 'private';
294 294
 
295
-                        if( method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope') ) {
295
+                        if (method_exists($this->NAMESPACE_ENDPOINTS[$api], 'scope')) {
296 296
                             $classScope = (new $this->NAMESPACE_ENDPOINTS[$api])->scope();
297 297
                             $position = array_search($path, $this->registry[$api]);
298 298
                             
299
-                            if( is_array($classScope) && isset($classScope[$position]) ) {
299
+                            if (is_array($classScope) && isset($classScope[$position])) {
300 300
                                 $scope = $classScope[$position];
301 301
 
302
-                            }else{
302
+                            } else {
303 303
 
304
-                                if( !is_array($classScope) ) {
304
+                                if (!is_array($classScope)) {
305 305
                                     $scope = $classScope;
306 306
                                 }
307 307
                             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $directory = $customService['directory'];
84 84
             $middleware = $customService['namespace'];
85 85
 
86
-        }else {
86
+        } else {
87 87
             $middleware = 'responsible';
88 88
 
89 89
             $endpoint = str_replace(
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 if (class_exists($child) && method_exists($child, 'register')) {
142 142
                     self::$middleWareClass = new $child;
143 143
                     $this->registry[$point] = self::$middleWareClass->register();
144
-                }else{
144
+                } else{
145 145
                     (new exception\errorException)
146 146
                         ->setOptions($this->getOptions())
147 147
                         ->message("Class Error:: class {$child} needs to exist. See documentation on setting up a service.")
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                         if( is_array($classScope) && isset($classScope[$position]) ) {
240 240
                             $endpointSettings['model']['scope'] = $classScope[$position];
241 241
 
242
-                        }else{
242
+                        } else{
243 243
 
244 244
                             if( !is_array($classScope) ) {
245 245
                                 $endpointSettings['model']['scope'] = $classScope;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                             if( is_array($classScope) && isset($classScope[$position]) ) {
300 300
                                 $scope = $classScope[$position];
301 301
 
302
-                            }else{
302
+                            } else{
303 303
 
304 304
                                 if( !is_array($classScope) ) {
305 305
                                     $scope = $classScope;
Please login to merge, or discard this patch.