@@ -55,7 +55,7 @@ |
||
55 | 55 | /** |
56 | 56 | * Returns builder is $mode. |
57 | 57 | * |
58 | - * @param $mode |
|
58 | + * @param string $mode |
|
59 | 59 | * |
60 | 60 | * @return bool |
61 | 61 | */ |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public function field($name) |
251 | 251 | { |
252 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
252 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
253 | 253 | return $field->column() == $name; |
254 | 254 | }); |
255 | 255 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $this->form->model()->getUpdatedAtColumn(), |
491 | 491 | ]; |
492 | 492 | |
493 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
493 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
494 | 494 | return in_array($field->column(), $reservedColumns); |
495 | 495 | }); |
496 | 496 | } |
@@ -158,7 +158,7 @@ |
||
158 | 158 | |
159 | 159 | list($relation, $args[0]) = explode('.', $this->column); |
160 | 160 | |
161 | - return ['whereHas' => [$relation, function ($relation) use ($args) { |
|
161 | + return ['whereHas' => [$relation, function($relation) use ($args) { |
|
162 | 162 | call_user_func_array([$relation, $this->query], $args); |
163 | 163 | }]]; |
164 | 164 | } |
@@ -331,7 +331,7 @@ |
||
331 | 331 | * |
332 | 332 | * @param Presenter $presenter |
333 | 333 | * |
334 | - * @return mixed |
|
334 | + * @return Presenter |
|
335 | 335 | */ |
336 | 336 | protected function setPresenter(Presenter $presenter) |
337 | 337 | { |
@@ -134,7 +134,7 @@ |
||
134 | 134 | public function style($style) |
135 | 135 | { |
136 | 136 | if (is_array($style)) { |
137 | - $style = implode('', array_map(function ($key, $val) { |
|
137 | + $style = implode('', array_map(function($key, $val) { |
|
138 | 138 | return "$key:$val"; |
139 | 139 | }, array_keys($style), array_values($style))); |
140 | 140 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | return $this->style([$styles]); |
65 | 65 | } |
66 | 66 | |
67 | - $styles = array_map(function ($style) { |
|
67 | + $styles = array_map(function($style) { |
|
68 | 68 | return 'box-'.$style; |
69 | 69 | }, $styles); |
70 | 70 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @param $permission |
14 | 14 | * |
15 | - * @return true |
|
15 | + * @return boolean|null |
|
16 | 16 | */ |
17 | 17 | public static function check($permission) |
18 | 18 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @param $roles |
32 | 32 | * |
33 | - * @return true |
|
33 | + * @return boolean|null |
|
34 | 34 | */ |
35 | 35 | public static function allow($roles) |
36 | 36 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @param $roles |
50 | 50 | * |
51 | - * @return true |
|
51 | + * @return boolean|null |
|
52 | 52 | */ |
53 | 53 | public static function deny($roles) |
54 | 54 | { |
@@ -22,7 +22,7 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | if (is_array($permission)) { |
25 | - collect($permission)->each(function ($permission) { |
|
25 | + collect($permission)->each(function($permission) { |
|
26 | 26 | call_user_func([self::class, 'check'], $permission); |
27 | 27 | }); |
28 | 28 |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * Resolve perPage for pagination. |
242 | 242 | * |
243 | - * @param array|null $paginate |
|
243 | + * @param Model $paginate |
|
244 | 244 | * |
245 | 245 | * @return array |
246 | 246 | */ |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | /** |
263 | 263 | * Find query by method name. |
264 | 264 | * |
265 | - * @param $method |
|
265 | + * @param string $method |
|
266 | 266 | * |
267 | 267 | * @return static |
268 | 268 | */ |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | |
349 | 349 | $this->setSort(); |
350 | 350 | |
351 | - $this->queries->reject(function ($query) { |
|
351 | + $this->queries->reject(function($query) { |
|
352 | 352 | return $query['method'] == 'paginate'; |
353 | - })->each(function ($query) { |
|
353 | + })->each(function($query) { |
|
354 | 354 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
355 | 355 | }); |
356 | 356 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $this->setSort(); |
402 | 402 | $this->setPaginate(); |
403 | 403 | |
404 | - $this->queries->unique()->each(function ($query) { |
|
404 | + $this->queries->unique()->each(function($query) { |
|
405 | 405 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
406 | 406 | }); |
407 | 407 | |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | |
432 | 432 | $queryBuilder = $this->originalModel; |
433 | 433 | |
434 | - $this->queries->reject(function ($query) { |
|
434 | + $this->queries->reject(function($query) { |
|
435 | 435 | return in_array($query['method'], ['get', 'paginate']); |
436 | - })->each(function ($query) use (&$queryBuilder) { |
|
436 | + })->each(function($query) use (&$queryBuilder) { |
|
437 | 437 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
438 | 438 | }); |
439 | 439 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $paginate = $this->findQueryByMethod('paginate'); |
469 | 469 | |
470 | - $this->queries = $this->queries->reject(function ($query) { |
|
470 | + $this->queries = $this->queries->reject(function($query) { |
|
471 | 471 | return $query['method'] == 'paginate'; |
472 | 472 | }); |
473 | 473 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | */ |
526 | 526 | protected function findQueryByMethod($method) |
527 | 527 | { |
528 | - return $this->queries->last(function ($query) use ($method) { |
|
528 | + return $this->queries->last(function($query) use ($method) { |
|
529 | 529 | return $query['method'] == $method; |
530 | 530 | }); |
531 | 531 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | { |
581 | 581 | list($relationName, $relationColumn) = explode('.', $column); |
582 | 582 | |
583 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
583 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
584 | 584 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
585 | 585 | })) { |
586 | 586 | $relation = $this->model->$relationName(); |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | */ |
615 | 615 | public function resetOrderBy() |
616 | 616 | { |
617 | - $this->queries = $this->queries->reject(function ($query) { |
|
617 | + $this->queries = $this->queries->reject(function($query) { |
|
618 | 618 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
619 | 619 | }); |
620 | 620 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Execute the console command. |
27 | 27 | * |
28 | - * @return void |
|
28 | + * @return false|null |
|
29 | 29 | */ |
30 | 30 | public function handle() |
31 | 31 | { |
@@ -131,7 +131,7 @@ |
||
131 | 131 | /** |
132 | 132 | * Get options of HTTP methods select field. |
133 | 133 | * |
134 | - * @return array |
|
134 | + * @return callable |
|
135 | 135 | */ |
136 | 136 | protected function getHttpMethodsOptions() |
137 | 137 | { |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | $grid->column('slug', trans('admin.slug')); |
33 | 33 | $grid->column('name', trans('admin.name')); |
34 | 34 | |
35 | - $grid->column('http_path', trans('admin.route'))->display(function ($path) { |
|
36 | - return collect(explode("\n", $path))->map(function ($path) { |
|
35 | + $grid->column('http_path', trans('admin.route'))->display(function($path) { |
|
36 | + return collect(explode("\n", $path))->map(function($path) { |
|
37 | 37 | $method = $this->http_method ?: ['ANY']; |
38 | 38 | |
39 | 39 | if (Str::contains($path, ':')) { |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | $method = explode(',', $method); |
42 | 42 | } |
43 | 43 | |
44 | - $method = collect($method)->map(function ($name) { |
|
44 | + $method = collect($method)->map(function($name) { |
|
45 | 45 | return strtoupper($name); |
46 | - })->map(function ($name) { |
|
46 | + })->map(function($name) { |
|
47 | 47 | return "<span class='label label-primary'>{$name}</span>"; |
48 | 48 | })->implode(' '); |
49 | 49 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | $grid->column('created_at', trans('admin.created_at')); |
59 | 59 | $grid->column('updated_at', trans('admin.updated_at')); |
60 | 60 | |
61 | - $grid->tools(function (Grid\Tools $tools) { |
|
62 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
61 | + $grid->tools(function(Grid\Tools $tools) { |
|
62 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
63 | 63 | $actions->disableDelete(); |
64 | 64 | }); |
65 | 65 | }); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $show->field('slug', trans('admin.slug')); |
85 | 85 | $show->field('name', trans('admin.name')); |
86 | 86 | |
87 | - $show->field('http_path', trans('admin.route'))->unescape()->as(function ($path) { |
|
88 | - return collect(explode("\r\n", $path))->map(function ($path) { |
|
87 | + $show->field('http_path', trans('admin.route'))->unescape()->as(function($path) { |
|
88 | + return collect(explode("\r\n", $path))->map(function($path) { |
|
89 | 89 | $method = $this->http_method ?: ['ANY']; |
90 | 90 | |
91 | 91 | if (Str::contains($path, ':')) { |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | $method = explode(',', $method); |
94 | 94 | } |
95 | 95 | |
96 | - $method = collect($method)->map(function ($name) { |
|
96 | + $method = collect($method)->map(function($name) { |
|
97 | 97 | return strtoupper($name); |
98 | - })->map(function ($name) { |
|
98 | + })->map(function($name) { |
|
99 | 99 | return "<span class='label label-primary'>{$name}</span>"; |
100 | 100 | })->implode(' '); |
101 | 101 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | * @param array|callable|string $options |
23 | 23 | * |
24 | - * @return $this|mixed |
|
24 | + * @return Checkbox |
|
25 | 25 | */ |
26 | 26 | public function options($options = []) |
27 | 27 | { |