Completed
Push — master ( 2f9ece...c4baa4 )
by Sherif
05:12 queued 45s
created
src/Modules/Core/AbstractRepositories/AbstractRepository.php 2 patches
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @param  array   $relations
53 53
      * @param  string  $sortBy
54
-     * @param  boolean $desc
54
+     * @param  integer $desc
55 55
      * @param  array   $columns
56 56
      * @return collection
57 57
      */
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param  integer $perPage
70 70
      * @param  array   $relations
71 71
      * @param  string  $sortBy
72
-     * @param  boolean $desc
72
+     * @param  integer $desc
73 73
      * @param  array   $columns
74 74
      * @return collection
75 75
      */
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      * @param  integer $perPage
117 117
      * @param  array   $relations
118 118
      * @param  string  $sortBy
119
-     * @param  boolean $desc
119
+     * @param  integer $desc
120 120
      * @param  array   $columns
121 121
      * @return collection
122 122
      */
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @param  integer $perPage
135 135
      * @param  array   $relations
136 136
      * @param  string  $sortBy
137
-     * @param  boolean $desc
137
+     * @param  integer $desc
138 138
      * @param  array   $columns
139 139
      * @return collection
140 140
      */
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
      * @param  array   $conditions array of conditions
392 392
      * @param  array   $relations
393 393
      * @param  string  $sortBy
394
-     * @param  boolean $desc
394
+     * @param  integer $desc
395 395
      * @param  array   $columns
396 396
      * @return collection
397 397
      */
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
      *
409 409
      * @param  array   $conditions array of conditions
410 410
      * @param  array   $relations
411
-     * @param  array   $colunmns
411
+     * @param  array   $columns
412 412
      * @return object
413 413
      */
414 414
     public function first($conditions, $relations = [], $columns = array('*'))
@@ -452,9 +452,9 @@  discard block
 block discarded – undo
452 452
      * Abstract method that is called in after
453 453
      * the save method finish.
454 454
      * 
455
-     * @param  object  $model
455
+     * @param  boolean  $model
456 456
      * @param  array   $relations
457
-     * @return void
457
+     * @return boolean
458 458
      */
459 459
     protected function afterSave($model, $relations)
460 460
     {
Please login to merge, or discard this 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/Modules/Core/Http/Controllers/BaseApiController.php 2 patches
Doc Comments   +13 added lines, -15 removed lines patch added patch discarded remove patch
@@ -54,9 +54,7 @@  discard block
 block discarded – undo
54 54
     /**
55 55
      * Fetch all records with relations from model repository.
56 56
      * 
57
-     * @param  string  $sortBy
58
-     * @param  boolean $desc
59
-     * @return \Illuminate\Http\Response
57
+     * @return \Illuminate\Http\JsonResponse|null
60 58
      */
61 59
     public function getIndex() 
62 60
     {
@@ -71,7 +69,7 @@  discard block
 block discarded – undo
71 69
      * Fetch the single object with relations from model repository.
72 70
      * 
73 71
      * @param  integer $id
74
-     * @return \Illuminate\Http\Response
72
+     * @return \Illuminate\Http\JsonResponse|null
75 73
      */
76 74
     public function getFind($id) 
77 75
     {
@@ -89,8 +87,8 @@  discard block
 block discarded – undo
89 87
      * @param  string  $query
90 88
      * @param  integer $perPage
91 89
      * @param  string  $sortBy
92
-     * @param  boolean $desc
93
-     * @return \Illuminate\Http\Response
90
+     * @param  integer $desc
91
+     * @return \Illuminate\Http\JsonResponse|null
94 92
      */
95 93
     public function getSearch($query = '', $perPage = 15, $sortBy = 'created_at', $desc = 1) 
96 94
     {
@@ -107,8 +105,8 @@  discard block
 block discarded – undo
107 105
      * 
108 106
      * @param  \Illuminate\Http\Request  $request
109 107
      * @param  string  $sortBy
110
-     * @param  boolean $desc
111
-     * @return \Illuminate\Http\Response
108
+     * @param  integer $desc
109
+     * @return \Illuminate\Http\JsonResponse|null
112 110
      */
113 111
     public function postFindby(Request $request, $sortBy = 'created_at', $desc = 1) 
114 112
     {
@@ -124,7 +122,7 @@  discard block
 block discarded – undo
124 122
      * condition.
125 123
      * 
126 124
      * @param  \Illuminate\Http\Request  $request
127
-     * @return \Illuminate\Http\Response
125
+     * @return \Illuminate\Http\JsonResponse|null
128 126
      */
129 127
     public function postFirst(Request $request) 
130 128
     {
@@ -140,8 +138,8 @@  discard block
 block discarded – undo
140 138
      * 
141 139
      * @param  integer $perPage
142 140
      * @param  string  $sortBy
143
-     * @param  boolean $desc
144
-     * @return \Illuminate\Http\Response
141
+     * @param  integer $desc
142
+     * @return \Illuminate\Http\JsonResponse|null
145 143
      */
146 144
     public function getPaginate($perPage = 15, $sortBy = 'created_at', $desc = 1) 
147 145
     {
@@ -159,8 +157,8 @@  discard block
 block discarded – undo
159 157
      * @param  \Illuminate\Http\Request  $request
160 158
      * @param  integer $perPage
161 159
      * @param  string  $sortBy
162
-     * @param  boolean $desc
163
-     * @return \Illuminate\Http\Response
160
+     * @param  integer $desc
161
+     * @return \Illuminate\Http\JsonResponse|null
164 162
      */
165 163
     public function postPaginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) 
166 164
     {
@@ -175,7 +173,7 @@  discard block
 block discarded – undo
175 173
      * Save the given model to repository.
176 174
      * 
177 175
      * @param  \Illuminate\Http\Request  $request
178
-     * @return \Illuminate\Http\Response
176
+     * @return \Illuminate\Http\JsonResponse|null
179 177
      */
180 178
     public function postSave(Request $request) 
181 179
     {
@@ -208,7 +206,7 @@  discard block
 block discarded – undo
208 206
      * Delete by the given id from model repository.
209 207
      * 
210 208
      * @param  integer  $id
211
-     * @return \Illuminate\Http\Response
209
+     * @return \Illuminate\Http\JsonResponse|null
212 210
      */
213 211
     public function getDelete($id) 
214 212
     {
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -189,8 +189,7 @@  discard block
 block discarded – undo
189 189
             if ($request->has('id')) 
190 190
             {
191 191
                 $rule = str_replace('{id}', $request->get('id'), $rule);
192
-            }
193
-            else
192
+            } else
194 193
             {
195 194
                 $rule = str_replace(',{id}', '', $rule);
196 195
             }
@@ -231,15 +230,13 @@  discard block
 block discarded – undo
231 230
         {
232 231
             $error = $this->errorHandler->notFound('method');
233 232
             abort($error['status'], $error['message']);
234
-        }
235
-        else if ( ! in_array($permission, $this->skipLoginCheck)) 
233
+        } else if ( ! in_array($permission, $this->skipLoginCheck)) 
236 234
         {
237 235
             if ( ! \Auth::check()) 
238 236
             {
239 237
                 $error = $this->errorHandler->unAuthorized();
240 238
                 abort($error['status'], $error['message']);
241
-            }
242
-            else if ( ! in_array($permission, $this->skipPermissionCheck) && 
239
+            } else if ( ! in_array($permission, $this->skipPermissionCheck) && 
243 240
                       ! \Core::users()->can($permission, $this->model))
244 241
             {
245 242
                 $error = $this->errorHandler->noPermissions();
Please login to merge, or discard this patch.
src/Modules/Core/Interfaces/RepositoryInterface.php 1 patch
Doc Comments   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
      * 
8 8
      * @param  array  $relations
9 9
      * @param  array   $sortBy
10
-     * @param  array   $desc
10
+     * @param  integer   $desc
11 11
      * @param  array  $columns
12 12
      * @return collection
13 13
      */
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @param  integer $perPage
22 22
      * @param  array   $relations
23 23
      * @param  array   $sortBy
24
-     * @param  array   $desc
24
+     * @param  integer   $desc
25 25
      * @param  array   $columns
26 26
      * @return collection
27 27
      */
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param  integer $perPage
34 34
      * @param  array   $relations
35 35
      * @param  array   $sortBy
36
-     * @param  array   $desc
36
+     * @param  integer   $desc
37 37
      * @param  array   $columns
38 38
      * @return collection
39 39
      */
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @param  integer $perPage
48 48
      * @param  array   $relations
49 49
      * @param  array   $sortBy
50
-     * @param  array   $desc
50
+     * @param  integer   $desc
51 51
      * @param  array   $columns
52 52
      * @return collection
53 53
      */
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * @param  array   $conditions array of conditions
110 110
      * @param  array   $relations
111 111
      * @param  array   $sortBy
112
-     * @param  array   $desc
112
+     * @param  integer   $desc
113 113
      * @param  array   $columns
114 114
      * @return collection
115 115
      */
@@ -120,7 +120,6 @@  discard block
 block discarded – undo
120 120
      * condition.
121 121
      * 
122 122
      * @param  array   $conditions array of conditions
123
-     * @param  [type]  $value condition value
124 123
      * @param  array   $relations
125 124
      * @param  array   $columns
126 125
      * @return object
Please login to merge, or discard this patch.
src/Modules/Reports/Repositories/ReportRepository.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      *
47 47
      * @param  array   $conditions array of conditions
48 48
      * @param  array   $relations
49
-     * @param  array   $colunmns
49
+     * @param  array   $columns
50 50
      * @return object
51 51
      */
52 52
     public function first($conditions, $relations = [], $columns = array('*'))
Please login to merge, or discard this patch.
src/Exceptions/Handler.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
             if ($e instanceof \Illuminate\Database\QueryException) 
52 52
             {
53 53
                 return \Response::json('Please check the given inputes', '400');
54
-            }
55
-            else if ($e instanceof \predis\connection\connectionexception) 
54
+            } else if ($e instanceof \predis\connection\connectionexception) 
56 55
             {
57 56
                 return \Response::json('Your redis notification server isn\'t running', '400');
58 57
             }
Please login to merge, or discard this patch.
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.