@@ -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 | */ |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function field($name) |
337 | 337 | { |
338 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
338 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
339 | 339 | return $field->column() === $name; |
340 | 340 | }); |
341 | 341 | } |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | |
535 | 535 | $this->form->getLayout()->removeReservedFields($reservedColumns); |
536 | 536 | |
537 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
537 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
538 | 538 | return in_array($field->column(), $reservedColumns, true); |
539 | 539 | }); |
540 | 540 | } |
@@ -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 | */ |
@@ -347,9 +347,9 @@ discard block |
||
347 | 347 | |
348 | 348 | $this->setSort(); |
349 | 349 | |
350 | - $this->queries->reject(function ($query) { |
|
350 | + $this->queries->reject(function($query) { |
|
351 | 351 | return $query['method'] == 'paginate'; |
352 | - })->each(function ($query) { |
|
352 | + })->each(function($query) { |
|
353 | 353 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
354 | 354 | }); |
355 | 355 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $this->setSort(); |
401 | 401 | $this->setPaginate(); |
402 | 402 | |
403 | - $this->queries->unique()->each(function ($query) { |
|
403 | + $this->queries->unique()->each(function($query) { |
|
404 | 404 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
405 | 405 | }); |
406 | 406 | |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | |
431 | 431 | $queryBuilder = $this->originalModel; |
432 | 432 | |
433 | - $this->queries->reject(function ($query) { |
|
433 | + $this->queries->reject(function($query) { |
|
434 | 434 | return in_array($query['method'], ['get', 'paginate']); |
435 | - })->each(function ($query) use (&$queryBuilder) { |
|
435 | + })->each(function($query) use (&$queryBuilder) { |
|
436 | 436 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
437 | 437 | }); |
438 | 438 | |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | { |
467 | 467 | $paginate = $this->findQueryByMethod('paginate'); |
468 | 468 | |
469 | - $this->queries = $this->queries->reject(function ($query) { |
|
469 | + $this->queries = $this->queries->reject(function($query) { |
|
470 | 470 | return $query['method'] == 'paginate'; |
471 | 471 | }); |
472 | 472 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | */ |
525 | 525 | protected function findQueryByMethod($method) |
526 | 526 | { |
527 | - return $this->queries->first(function ($query) use ($method) { |
|
527 | + return $this->queries->first(function($query) use ($method) { |
|
528 | 528 | return $query['method'] == $method; |
529 | 529 | }); |
530 | 530 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | $columnNameContainsDots = Str::contains($columnName, '.'); |
550 | - $isRelation = $this->queries->contains(function ($query) use ($columnName) { |
|
550 | + $isRelation = $this->queries->contains(function($query) use ($columnName) { |
|
551 | 551 | return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true); |
552 | 552 | }); |
553 | 553 | if ($columnNameContainsDots === true && $isRelation) { |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | { |
594 | 594 | list($relationName, $relationColumn) = explode('.', $column); |
595 | 595 | |
596 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
596 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
597 | 597 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
598 | 598 | })) { |
599 | 599 | $relation = $this->model->$relationName(); |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | */ |
628 | 628 | public function resetOrderBy() |
629 | 629 | { |
630 | - $this->queries = $this->queries->reject(function ($query) { |
|
630 | + $this->queries = $this->queries->reject(function($query) { |
|
631 | 631 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
632 | 632 | }); |
633 | 633 | } |
@@ -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 | { |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @param string $target |
30 | 30 | * |
31 | - * @return mixed |
|
31 | + * @return string |
|
32 | 32 | */ |
33 | 33 | public function callInterventionMethods($target) |
34 | 34 | { |
@@ -169,7 +169,7 @@ |
||
169 | 169 | |
170 | 170 | $action = $size[2] ?? 'resize'; |
171 | 171 | // Resize image with aspect ratio |
172 | - $image->$action($size[0], $size[1], function (Constraint $constraint) { |
|
172 | + $image->$action($size[0], $size[1], function(Constraint $constraint) { |
|
173 | 173 | $constraint->aspectRatio(); |
174 | 174 | })->resizeCanvas($size[0], $size[1], 'center', false, '#ffffff'); |
175 | 175 |
@@ -8,6 +8,9 @@ discard block |
||
8 | 8 | |
9 | 9 | protected $append; |
10 | 10 | |
11 | + /** |
|
12 | + * @param string $string |
|
13 | + */ |
|
11 | 14 | public function prepend($string) |
12 | 15 | { |
13 | 16 | if (is_null($this->prepend)) { |
@@ -17,6 +20,9 @@ discard block |
||
17 | 20 | return $this; |
18 | 21 | } |
19 | 22 | |
23 | + /** |
|
24 | + * @param string $string |
|
25 | + */ |
|
20 | 26 | public function append($string) |
21 | 27 | { |
22 | 28 | if (is_null($this->append)) { |
@@ -33,6 +39,9 @@ discard block |
||
33 | 39 | } |
34 | 40 | } |
35 | 41 | |
42 | + /** |
|
43 | + * @param string $attribute |
|
44 | + */ |
|
36 | 45 | protected function defaultAttribute($attribute, $value) |
37 | 46 | { |
38 | 47 | if (!array_key_exists($attribute, $this->attributes)) { |