Completed
Push — master ( c8ea4b...c4213a )
by Sherif
02:51
created
src/Modules/Acl/Http/Controllers/UsersController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,7 @@
 block discarded – undo
84 84
         {
85 85
             $relations = $this->relations && $this->relations['find'] ? $this->relations['find'] : [];
86 86
             return \Response::json(call_user_func_array("\Core::{$this->model}", [])->find(\Auth::id(), $relations), 200);
87
-        }
88
-        else
87
+        } else
89 88
         {
90 89
             $error = $this->errorHandler->loginFailed();
91 90
             abort($error['status'], $error['message']);
Please login to merge, or discard this patch.
src/Modules/Core/AbstractRepositories/AbstractRepository.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -213,8 +213,7 @@  discard block
 block discarded – undo
213 213
                                     }
214 214
                                 }
215 215
                                 $relations[$relation][] = $relationModel;
216
-                            }
217
-                            else
216
+                            } else
218 217
                             {
219 218
                                 if (gettype($val) !== 'object' && gettype($val) !== 'array') 
220 219
                                 {
@@ -234,8 +233,7 @@  discard block
 block discarded – undo
234 233
                             }
235 234
                         }
236 235
                     }
237
-                }
238
-                else if (array_search($key, $model->getFillable(), true) !== false)
236
+                } else if (array_search($key, $model->getFillable(), true) !== false)
239 237
                 {
240 238
                     $model->$key = $value;   
241 239
                 }
@@ -247,8 +245,7 @@  discard block
 block discarded – undo
247 245
                 if ($value == 'delete' && $model->$key()->count())
248 246
                 {
249 247
                     $model->$key()->delete();
250
-                }
251
-                else if (gettype($value) == 'array') 
248
+                } else if (gettype($value) == 'array') 
252 249
                 {
253 250
                     $ids = [];
254 251
                     foreach ($value as $val) 
@@ -279,8 +276,7 @@  discard block
 block discarded – undo
279 276
                             $model->$key()->attach($ids);
280 277
                             break;
281 278
                     }
282
-                }
283
-                else
279
+                } else
284 280
                 {
285 281
                     switch (class_basename($model->$key())) 
286 282
                     {
@@ -358,8 +354,7 @@  discard block
 block discarded – undo
358 354
                 $model->delete();
359 355
                 $saveLog ? $this->logs->saveLog('delete', class_basename($this->model), $this->getModel(), $value, $model) : false;
360 356
             });
361
-    	}
362
-        else
357
+    	} else
363 358
         {
364 359
             \DB::transaction(function () use ($value, $attribute, &$result, $saveLog) {
365 360
                 call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function ($model){
@@ -432,13 +427,11 @@  discard block
 block discarded – undo
432 427
             {
433 428
                 $conditionString  .= str_replace('{op}', 'and', $this->constructConditions($value)['conditionString']) . ' {op} ';
434 429
                 $conditionValues   = array_merge($conditionValues, $this->constructConditions($value)['conditionValues']);
435
-            }
436
-            else if ($key == 'or')
430
+            } else if ($key == 'or')
437 431
             {
438 432
                 $conditionString  .= str_replace('{op}', 'or', $this->constructConditions($value)['conditionString']) . ' {op} ';
439 433
                 $conditionValues   = array_merge($conditionValues, $this->constructConditions($value)['conditionValues']);
440
-            }
441
-            else
434
+            } else
442 435
             {
443 436
                 $conditionString  .= $key . '=? {op} ';
444 437
                 $conditionValues[] = $value;
Please login to merge, or discard this patch.
src/Exceptions/Handler.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -52,32 +52,26 @@
 block discarded – undo
52 52
             {
53 53
                 $error = \ErrorHandler::dbQueryError();
54 54
                 return \Response::json($error['message'], $error['status']);
55
-            }
56
-            else if ($e instanceof \predis\connection\connectionexception) 
55
+            } else if ($e instanceof \predis\connection\connectionexception) 
57 56
             {
58 57
                 $error = \ErrorHandler::redisNotRunning();
59 58
                 return \Response::json($error['message'], $error['status']);
60
-            }
61
-            else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) 
59
+            } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) 
62 60
             {
63 61
                 $error = \ErrorHandler::tokenExpired();
64 62
                 return \Response::json($error['message'], $error['status']);
65
-            } 
66
-            else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) 
63
+            } else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) 
67 64
             {
68 65
                 $error = \ErrorHandler::noPermissions();
69 66
                 return \Response::json($error['message'], $error['status']);
70
-            }
71
-            else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) 
67
+            } else if ($e instanceof \Tymon\JWTAuth\Exceptions\JWTException) 
72 68
             {
73 69
                 $error = \ErrorHandler::unAuthorized();
74 70
                 return \Response::json($error['message'], $error['status']);
75
-            }
76
-            else if ($e instanceof HttpException) 
71
+            } else if ($e instanceof HttpException) 
77 72
             {
78 73
                 return \Response::json($e->getMessage(), $e->getStatusCode());   
79
-            }
80
-            else
74
+            } else
81 75
             {
82 76
                 return parent::render($request, $e);
83 77
             }
Please login to merge, or discard this patch.
src/Modules/Core/Http/Controllers/BaseApiController.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -190,8 +190,7 @@  discard block
 block discarded – undo
190 190
             if ($request->has('id')) 
191 191
             {
192 192
                 $rule = str_replace('{id}', $request->get('id'), $rule);
193
-            }
194
-            else
193
+            } else
195 194
             {
196 195
                 $rule = str_replace(',{id}', '', $rule);
197 196
             }
@@ -232,8 +231,7 @@  discard block
 block discarded – undo
232 231
         {
233 232
             $error = $this->errorHandler->notFound('method');
234 233
             abort($error['status'], $error['message']);
235
-        }
236
-        else if ( ! in_array($permission, $this->skipLoginCheck)) 
234
+        } else if ( ! in_array($permission, $this->skipLoginCheck)) 
237 235
         {
238 236
             \JWTAuth::parseToken()->authenticate();
239 237
             if ( ! in_array($permission, $this->skipPermissionCheck) && ! \Core::users()->can($permission, $this->model))
Please login to merge, or discard this patch.