Completed
Push — master ( 7f4033...c0246b )
by Sherif
02:56
created
src/Modules/Acl/Http/Controllers/UsersController.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * Return the logged in user account.
43 43
      * 
44
-     * @return object
44
+     * @return \Illuminate\Http\JsonResponse
45 45
      */
46 46
     public function getAccount()
47 47
     {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     /**
53 53
      * Logout the user.
54 54
      * 
55
-     * @return void
55
+     * @return \Illuminate\Http\JsonResponse
56 56
      */
57 57
     public function getLogout()
58 58
     {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * Handle a registration request.
64 64
      *
65 65
      * @param  \Illuminate\Http\Request  $request
66
-     * @return \Illuminate\Http\Response
66
+     * @return \Illuminate\Http\JsonResponse
67 67
      */
68 68
     public function postRegister(Request $request)
69 69
     {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * Handle a login request to the application.
77 77
      *
78 78
      * @param  \Illuminate\Http\Request  $request
79
-     * @return \Illuminate\Http\Response
79
+     * @return \Illuminate\Http\JsonResponse|null
80 80
      */
81 81
     public function postLogin(Request $request)
82 82
     {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      * Handle an assign groups to user request.
97 97
      *
98 98
      * @param  \Illuminate\Http\Request  $request
99
-     * @return \Illuminate\Http\Response
99
+     * @return \Illuminate\Http\JsonResponse
100 100
      */
101 101
     public function postAssigngroups(Request $request)
102 102
     {
Please login to merge, or discard this 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/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   +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.
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/Core/AbstractRepositories/AbstractRepository.php 2 patches
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.
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @param  array   $relations
34 34
      * @param  string  $sortBy
35
-     * @param  boolean $desc
35
+     * @param  integer $desc
36 36
      * @param  array   $columns
37 37
      * @return collection
38 38
      */
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @param  integer $perPage
51 51
      * @param  array   $relations
52 52
      * @param  string  $sortBy
53
-     * @param  boolean $desc
53
+     * @param  integer $desc
54 54
      * @param  array   $columns
55 55
      * @return collection
56 56
      */
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @param  integer $perPage
98 98
      * @param  array   $relations
99 99
      * @param  string  $sortBy
100
-     * @param  boolean $desc
100
+     * @param  integer $desc
101 101
      * @param  array   $columns
102 102
      * @return collection
103 103
      */
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      * @param  integer $perPage
116 116
      * @param  array   $relations
117 117
      * @param  string  $sortBy
118
-     * @param  boolean $desc
118
+     * @param  integer $desc
119 119
      * @param  array   $columns
120 120
      * @return collection
121 121
      */
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      * @param  array   $conditions array of conditions
373 373
      * @param  array   $relations
374 374
      * @param  string  $sortBy
375
-     * @param  boolean $desc
375
+     * @param  integer $desc
376 376
      * @param  array   $columns
377 377
      * @return collection
378 378
      */
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
      * Abstract method that is called in after
434 434
      * the save method finish.
435 435
      * 
436
-     * @param  object  $model
436
+     * @param  boolean  $model
437 437
      * @param  array   $relations
438
-     * @return void
438
+     * @return boolean
439 439
      */
440 440
     protected function afterSave($model, $relations)
441 441
     {
Please login to merge, or discard this patch.
src/Modules/Reporting/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.