Passed
Push — master ( 80668e...5fb0ac )
by Vince
01:41
created
src/core/throttle/limiter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
      */
296 296
     public function getAccount()
297 297
     {
298
-        if (is_null($this->account)||empty($this->account)) {
298
+        if (is_null($this->account) || empty($this->account)) {
299 299
             (new exception\errorException)
300 300
                 ->setOptions($this->getOptions())
301 301
                 ->error('UNAUTHORIZED');
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
         if (is_numeric($timeframe)) {
402 402
             if ($timeframe < 0) {
403
-                $timeframe = ($timeframe*-1);
403
+                $timeframe = ($timeframe * -1);
404 404
             }
405 405
             self::$timeframe['CUSTOM'] = $timeframe;
406 406
             $this->window = intval(self::$timeframe['CUSTOM']);
Please login to merge, or discard this patch.
src/core/server.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      * [getOptions Get the stored Responsible API options]
163 163
      * @return array|null
164 164
      */
165
-    public function getOptions():?array
165
+    public function getOptions(): ?array
166 166
     {
167 167
         return $this->options;
168 168
     }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             return;
217 217
         }
218 218
         if (is_null($key) || $key == '') {
219
-            if( !is_null($response) ) {
219
+            if (!is_null($response)) {
220 220
                 $this->RESPONSE['response'] = $response;
221 221
             }
222 222
             return;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     public function authenticate()
259 259
     {
260 260
         $options = $this->getOptions();
261
-        $route = (isset($options['route']) && !empty($options['route']) ) ? $options['route'] : '';
261
+        $route = (isset($options['route']) && !empty($options['route'])) ? $options['route'] : '';
262 262
 
263 263
         $this->endpoints->baseApiRoot(dirname(__DIR__));
264 264
         $this->endpoints->register();
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $this->router = $router->route($route);
270 270
         $endpoint = $this->endpoints->isEndpoint($router->getApi(), $router->getPath());
271 271
 
272
-        if(isset($endpoint->model['scope'])) {
272
+        if (isset($endpoint->model['scope'])) {
273 273
             $_REQUEST['scope'] = $endpoint->model['scope'];
274 274
             $this->header->setData($_REQUEST);
275 275
         }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         /**
348 348
          * Check if theres a payload sent
349 349
          */
350
-        if(isset($_REQUEST['payload'])) {
350
+        if (isset($_REQUEST['payload'])) {
351 351
             $router->setRequestBody($_REQUEST['payload']);
352 352
         }
353 353
         // print_r($_REQUEST);
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
         /**
360 360
          * Check the access scope
361 361
          */
362
-        if( !isset($this->router->endpoint->model['scope']) ) {
362
+        if (!isset($this->router->endpoint->model['scope'])) {
363 363
             $this->router->endpoint->model['scope'] = 'private';
364 364
         }
365 365
 
366
-        if( isset($this->header->getMethod()->data['scope']) && 
366
+        if (isset($this->header->getMethod()->data['scope']) && 
367 367
             ($this->header->getMethod()->data['scope'] == 'anonymous')
368 368
         ) {
369 369
             $this->router->endpoint->model['scope'] = 'anonymous';
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/user/user.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
      */
155 155
     private function updateAccount($properties)
156 156
     {
157
-        if( is_array($properties) ) {
157
+        if (is_array($properties)) {
158 158
             $properties = (object) $properties; //json_decode(json_encode($properties));
159 159
         }
160 160
 
161
-        if( !isset($properties->update) || 
161
+        if (!isset($properties->update) || 
162 162
             !isset($properties->where) || 
163 163
             (isset($properties->update) && !is_array($properties->update)) ||
164 164
             (isset($properties->where) && !is_array($properties->where))
@@ -185,16 +185,16 @@  discard block
 block discarded – undo
185 185
          * @var [type]
186 186
          */
187 187
         foreach ($properties->update as $u => $update) {
188
-            if( !in_array($u, $allowedFileds) ) {
188
+            if (!in_array($u, $allowedFileds)) {
189 189
                 unset($properties->update[$u]);
190
-            }else{
190
+            } else {
191 191
                 $set .= $u . ' = :' . $u . ',';
192 192
                 $binds[$u] = $update;
193 193
             }
194 194
         }
195 195
 
196 196
         $set = rtrim($set, ',');
197
-        $where =  key($properties->where) . ' = ' . $properties->where[key($properties->where)];
197
+        $where = key($properties->where) . ' = ' . $properties->where[key($properties->where)];
198 198
 
199 199
         return $this->DB()->
200 200
             query(
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $options = $this->getOptions();
241 241
         $skipValidatation = false;
242 242
 
243
-        if( isset($options['validate']) && $options['validate'] == false ) {
243
+        if (isset($options['validate']) && $options['validate'] == false) {
244 244
             $skipValidatation = true;
245 245
         }
246 246
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                 break;
257 257
 
258 258
             case 'mail':
259
-                if( !filter_var($property, FILTER_VALIDATE_EMAIL) && !$skipValidatation) {
259
+                if (!filter_var($property, FILTER_VALIDATE_EMAIL) && !$skipValidatation) {
260 260
                     return false;
261 261
                 }
262 262
                 $this->mail = $property;
Please login to merge, or discard this patch.
src/core/route/router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             'post' => $payload
96 96
         ];
97 97
 
98
-        if( isset($this->requestBody['payload']) ) {
98
+        if (isset($this->requestBody['payload'])) {
99 99
             array_merge($this->requestBody['payload'], $payloadPost);
100 100
             return;
101 101
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function getRequestBody()
122 122
     {
123
-        if( isset($this->requestBody['payload']) ) {
123
+        if (isset($this->requestBody['payload'])) {
124 124
             return $this->requestBody['payload'];
125 125
         }
126 126
         return $this->requestBody;
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             ),
173 173
         );
174 174
 
175
-        $this->setRoutes((object)$routesArray);
175
+        $this->setRoutes((object) $routesArray);
176 176
 
177 177
         return $this->getRoutes();
178 178
     }
Please login to merge, or discard this patch.