@@ -199,7 +199,7 @@ |
||
199 | 199 | /** |
200 | 200 | * Get the given method body code. |
201 | 201 | * |
202 | - * @param object $reflectionMethod |
|
202 | + * @param \ReflectionMethod $reflectionMethod |
|
203 | 203 | * @return string |
204 | 204 | */ |
205 | 205 | protected function getMethodBody($reflectionMethod) |
@@ -28,10 +28,6 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * @param string $uri |
|
32 | - * @param array $data |
|
33 | - * @param array $headers |
|
34 | - * @param string $content |
|
35 | 31 | * @return \Illuminate\Http\Response |
36 | 32 | */ |
37 | 33 | public function get() |
@@ -40,10 +36,6 @@ discard block |
||
40 | 36 | } |
41 | 37 | |
42 | 38 | /** |
43 | - * @param string $uri |
|
44 | - * @param array $data |
|
45 | - * @param array $headers |
|
46 | - * @param string $content |
|
47 | 39 | * @return \Illuminate\Http\Response |
48 | 40 | */ |
49 | 41 | public function post() |
@@ -52,10 +44,6 @@ discard block |
||
52 | 44 | } |
53 | 45 | |
54 | 46 | /** |
55 | - * @param string $uri |
|
56 | - * @param array $data |
|
57 | - * @param array $headers |
|
58 | - * @param string $content |
|
59 | 47 | * @return \Illuminate\Http\Response |
60 | 48 | */ |
61 | 49 | public function put() |
@@ -64,10 +52,6 @@ discard block |
||
64 | 52 | } |
65 | 53 | |
66 | 54 | /** |
67 | - * @param string $uri |
|
68 | - * @param array $data |
|
69 | - * @param array $headers |
|
70 | - * @param string $content |
|
71 | 55 | * @return \Illuminate\Http\Response |
72 | 56 | */ |
73 | 57 | public function delete() |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @param array $relations |
36 | 36 | * @param string $sortBy |
37 | - * @param boolean $desc |
|
37 | + * @param integer $desc |
|
38 | 38 | * @param array $columns |
39 | 39 | * @return collection |
40 | 40 | */ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param integer $perPage |
53 | 53 | * @param array $relations |
54 | 54 | * @param string $sortBy |
55 | - * @param boolean $desc |
|
55 | + * @param integer $desc |
|
56 | 56 | * @param array $columns |
57 | 57 | * @return collection |
58 | 58 | */ |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @param integer $perPage |
155 | 155 | * @param array $relations |
156 | 156 | * @param string $sortBy |
157 | - * @param boolean $desc |
|
157 | + * @param integer $desc |
|
158 | 158 | * @param array $columns |
159 | 159 | * @return collection |
160 | 160 | */ |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param integer $perPage |
173 | 173 | * @param array $relations |
174 | 174 | * @param string $sortBy |
175 | - * @param boolean $desc |
|
175 | + * @param integer $desc |
|
176 | 176 | * @param array $columns |
177 | 177 | * @return collection |
178 | 178 | */ |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * Save the given model to the storage. |
189 | 189 | * |
190 | 190 | * @param array $data |
191 | - * @return mixed |
|
191 | + * @return boolean |
|
192 | 192 | */ |
193 | 193 | public function save(array $data) |
194 | 194 | { |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | * @param array $conditions array of conditions |
478 | 478 | * @param array $relations |
479 | 479 | * @param string $sortBy |
480 | - * @param boolean $desc |
|
480 | + * @param integer $desc |
|
481 | 481 | * @param array $columns |
482 | 482 | * @return collection |
483 | 483 | */ |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param array $conditions array of conditions |
510 | 510 | * @param integer $perPage |
511 | 511 | * @param string $sortBy |
512 | - * @param boolean $desc |
|
512 | + * @param integer $desc |
|
513 | 513 | * @param array $columns |
514 | 514 | * @return collection |
515 | 515 | */ |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct($model) |
23 | 23 | { |
24 | - $this->model = $model; |
|
24 | + $this->model = $model; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * Construct the select conditions for the model. |
87 | 87 | */ |
88 | - $model->where(function ($q) use ($query, $conditionColumns, $relations) { |
|
88 | + $model->where(function($q) use ($query, $conditionColumns, $relations) { |
|
89 | 89 | |
90 | 90 | if (count($conditionColumns)) { |
91 | 91 | $column = 'LOWER('.array_shift($conditionColumns).')'; |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | /** |
128 | 128 | * Construct the relation condition. |
129 | 129 | */ |
130 | - $q->orWhereHas($relation, function ($subModel) use ($query, $relation) { |
|
130 | + $q->orWhereHas($relation, function($subModel) use ($query, $relation) { |
|
131 | 131 | |
132 | - $subModel->where(function ($q) use ($query, $relation) { |
|
132 | + $subModel->where(function($q) use ($query, $relation) { |
|
133 | 133 | |
134 | 134 | /** |
135 | 135 | * Get columns of the relation. |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $model = false; |
216 | 216 | $relations = []; |
217 | 217 | |
218 | - \DB::transaction(function () use (&$model, $relations, $data) { |
|
218 | + \DB::transaction(function() use (&$model, $relations, $data) { |
|
219 | 219 | |
220 | 220 | $model = $this->prepareModel($data); |
221 | 221 | $relations = $this->prepareRelations($data, $model); |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | public function delete($value, $attribute = 'id') |
237 | 237 | { |
238 | 238 | if ($attribute == 'id') { |
239 | - \DB::transaction(function () use ($value) { |
|
239 | + \DB::transaction(function() use ($value) { |
|
240 | 240 | $model = $this->model->lockForUpdate()->find($value); |
241 | - if (! $model) { |
|
241 | + if ( ! $model) { |
|
242 | 242 | \ErrorHandler::notFound(class_basename($this->model).' with id : '.$value); |
243 | 243 | } |
244 | 244 | |
245 | 245 | $model->delete(); |
246 | 246 | }); |
247 | 247 | } else { |
248 | - \DB::transaction(function () use ($value, $attribute) { |
|
249 | - $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) { |
|
248 | + \DB::transaction(function() use ($value, $attribute) { |
|
249 | + $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) { |
|
250 | 250 | $model->delete(); |
251 | 251 | }); |
252 | 252 | }); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | { |
338 | 338 | $model = $this->model->onlyTrashed()->find($id); |
339 | 339 | |
340 | - if (! $model) { |
|
340 | + if ( ! $model) { |
|
341 | 341 | \ErrorHandler::notFound(class_basename($this->model).' with id : '.$id); |
342 | 342 | } |
343 | 343 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | * @var array |
362 | 362 | */ |
363 | 363 | $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass; |
364 | - if (! $model) { |
|
364 | + if ( ! $model) { |
|
365 | 365 | \ErrorHandler::notFound(class_basename($modelClass).' with id : '.$data['id']); |
366 | 366 | } |
367 | 367 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * If the relation has no value then marke the relation data |
412 | 412 | * related to the model to be deleted. |
413 | 413 | */ |
414 | - if (! $value || ! count($value)) { |
|
414 | + if ( ! $value || ! count($value)) { |
|
415 | 415 | $relations[$relation] = 'delete'; |
416 | 416 | } |
417 | 417 | } |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | /** |
439 | 439 | * If model doesn't exists. |
440 | 440 | */ |
441 | - if (! $relationModel) { |
|
441 | + if ( ! $relationModel) { |
|
442 | 442 | \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$val['id']); |
443 | 443 | } |
444 | 444 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | /** |
470 | 470 | * If model doesn't exists. |
471 | 471 | */ |
472 | - if (! $relationModel) { |
|
472 | + if ( ! $relationModel) { |
|
473 | 473 | \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$value['id']); |
474 | 474 | } |
475 | 475 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $value = $removeLast === false ? $value : substr($value, 0, $removeLast); |
676 | 676 | $path = explode('->', $value); |
677 | 677 | $field = array_shift($path); |
678 | - $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) { |
|
678 | + $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) { |
|
679 | 679 | return '"'.$part.'"'; |
680 | 680 | })->implode('.')); |
681 | 681 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * Init new object. |
35 | 35 | * |
36 | 36 | * @param mixed $repo |
37 | - * @param CoreConfig $config |
|
37 | + * @param \App\Modules\Core\Utl\CoreConfig $config |
|
38 | 38 | * @param string $modelResource |
39 | 39 | * @return void |
40 | 40 | */ |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @param Request $request |
35 | 35 | * @param string $reportName Name of the requested report |
36 | - * @return \Illuminate\Http\Response |
|
36 | + * @return \Illuminate\Http\JsonResponse |
|
37 | 37 | */ |
38 | 38 | public function getReport(Request $request, $reportName) |
39 | 39 | { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * Register the given device to the logged in user. |
22 | 22 | * |
23 | 23 | * @param array $data |
24 | - * @return void |
|
24 | + * @return boolean |
|
25 | 25 | */ |
26 | 26 | public function registerDevice($data) |
27 | 27 | { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @param array $credentials |
146 | 146 | * @param boolean $skipConfirmEmail |
147 | - * @return array |
|
147 | + * @return boolean |
|
148 | 148 | */ |
149 | 149 | public function register($credentials, $skipConfirmEmail = false) |
150 | 150 | { |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | * Save the given data to the logged in user. |
345 | 345 | * |
346 | 346 | * @param array $data |
347 | - * @return void |
|
347 | + * @return boolean |
|
348 | 348 | */ |
349 | 349 | public function saveProfile($data) |
350 | 350 | { |
@@ -183,6 +183,11 @@ |
||
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
186 | + /** |
|
187 | + * @param string $contents |
|
188 | + * |
|
189 | + * @return string |
|
190 | + */ |
|
186 | 191 | protected function replacePlaceholders($contents) |
187 | 192 | { |
188 | 193 | $modelName = \Str::camel($this->container['slug']); |