@@ -31,7 +31,7 @@ |
||
31 | 31 | * Generate thumbnail URL. |
32 | 32 | * |
33 | 33 | * @param $image |
34 | - * @param $type |
|
34 | + * @param string $type |
|
35 | 35 | * |
36 | 36 | * @return string |
37 | 37 | */ |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * |
55 | 55 | * @param bool $toArray |
56 | 56 | * |
57 | - * @return array|Collection|mixed |
|
57 | + * @return Collection |
|
58 | 58 | */ |
59 | 59 | public function applyFilter($toArray = true) |
60 | 60 | { |
@@ -125,14 +125,14 @@ |
||
125 | 125 | */ |
126 | 126 | protected function parseQueryBindings(array $queries) |
127 | 127 | { |
128 | - $columnMap = $this->columns->mapWithKeys(function (Column $column) { |
|
128 | + $columnMap = $this->columns->mapWithKeys(function(Column $column) { |
|
129 | 129 | $label = $column->getLabel(); |
130 | 130 | $name = $column->getName(); |
131 | 131 | |
132 | 132 | return [$label => $name, $name => $name]; |
133 | 133 | }); |
134 | 134 | |
135 | - return collect($queries)->map(function ($query) use ($columnMap) { |
|
135 | + return collect($queries)->map(function($query) use ($columnMap) { |
|
136 | 136 | $segments = explode(':', $query, 2); |
137 | 137 | |
138 | 138 | if (count($segments) != 2) { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | /** |
167 | 167 | * Extend column displayer. |
168 | 168 | * |
169 | - * @param $name |
|
169 | + * @param string $name |
|
170 | 170 | * @param $displayer |
171 | 171 | */ |
172 | 172 | public static function extend($name, $displayer) |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** |
201 | 201 | * Set model for column. |
202 | 202 | * |
203 | - * @param $model |
|
203 | + * @param Model $model |
|
204 | 204 | */ |
205 | 205 | public function setModel($model) |
206 | 206 | { |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | /** |
285 | 285 | * Get name of this column. |
286 | 286 | * |
287 | - * @return mixed |
|
287 | + * @return string |
|
288 | 288 | */ |
289 | 289 | public function getName() |
290 | 290 | { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | /** |
313 | 313 | * Get label of the column. |
314 | 314 | * |
315 | - * @return mixed |
|
315 | + * @return string |
|
316 | 316 | */ |
317 | 317 | public function getLabel() |
318 | 318 | { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | * Display using display abstract. |
400 | 400 | * |
401 | 401 | * @param string $abstract |
402 | - * @param array $arguments |
|
402 | + * @param Closure[] $arguments |
|
403 | 403 | * |
404 | 404 | * @return $this |
405 | 405 | */ |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | |
407 | 407 | $column = $this; |
408 | 408 | |
409 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
409 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
410 | 410 | /** @var AbstractDisplayer $displayer */ |
411 | 411 | $displayer = new $abstract($value, $grid, $column, $this); |
412 | 412 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | */ |
425 | 425 | public function using(array $values, $default = null) |
426 | 426 | { |
427 | - return $this->display(function ($value) use ($values, $default) { |
|
427 | + return $this->display(function($value) use ($values, $default) { |
|
428 | 428 | if (is_null($value)) { |
429 | 429 | return $default; |
430 | 430 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function replace(array $replacements) |
444 | 444 | { |
445 | - return $this->display(function ($value) use ($replacements) { |
|
445 | + return $this->display(function($value) use ($replacements) { |
|
446 | 446 | if (isset($replacements[$value])) { |
447 | 447 | return $replacements[$value]; |
448 | 448 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | */ |
461 | 461 | public function view($view) |
462 | 462 | { |
463 | - return $this->display(function ($value) use ($view) { |
|
463 | + return $this->display(function($value) use ($view) { |
|
464 | 464 | $model = $this; |
465 | 465 | |
466 | 466 | return view($view, compact('model', 'value'))->render(); |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | */ |
501 | 501 | public function filesize() |
502 | 502 | { |
503 | - return $this->display(function ($value) { |
|
503 | + return $this->display(function($value) { |
|
504 | 504 | return file_size($value); |
505 | 505 | }); |
506 | 506 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | */ |
515 | 515 | public function gravatar($size = 30) |
516 | 516 | { |
517 | - return $this->display(function ($value) use ($size) { |
|
517 | + return $this->display(function($value) use ($size) { |
|
518 | 518 | $src = sprintf( |
519 | 519 | 'https://www.gravatar.com/avatar/%s?s=%d', |
520 | 520 | md5(strtolower($value)), |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | */ |
536 | 536 | public function loading($values = [], $others = []) |
537 | 537 | { |
538 | - return $this->display(function ($value) use ($values, $others) { |
|
538 | + return $this->display(function($value) use ($values, $others) { |
|
539 | 539 | $values = (array) $values; |
540 | 540 | |
541 | 541 | if (in_array($value, $values)) { |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | */ |
557 | 557 | public function icon(array $setting, $default = '') |
558 | 558 | { |
559 | - return $this->display(function ($value) use ($setting, $default) { |
|
559 | + return $this->display(function($value) use ($setting, $default) { |
|
560 | 560 | $fa = ''; |
561 | 561 | |
562 | 562 | if (isset($setting[$value])) { |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | Carbon::setLocale($locale); |
583 | 583 | } |
584 | 584 | |
585 | - return $this->display(function ($value) { |
|
585 | + return $this->display(function($value) { |
|
586 | 586 | return Carbon::parse($value)->diffForHumans(); |
587 | 587 | }); |
588 | 588 | } |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | $grid = $this->grid; |
704 | 704 | $column = $this; |
705 | 705 | |
706 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
706 | + $this->display(function($value) use ($grid, $column, $class) { |
|
707 | 707 | /** @var AbstractDisplayer $definition */ |
708 | 708 | $definition = new $class($value, $grid, $column, $this); |
709 | 709 | |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | protected function htmlEntityEncode($item) |
722 | 722 | { |
723 | 723 | if (is_array($item)) { |
724 | - array_walk_recursive($item, function (&$value) { |
|
724 | + array_walk_recursive($item, function(&$value) { |
|
725 | 725 | $value = htmlentities($value); |
726 | 726 | }); |
727 | 727 | } else { |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | */ |
759 | 759 | protected function callSupportDisplayer($abstract, $arguments) |
760 | 760 | { |
761 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
761 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
762 | 762 | if (is_array($value) || $value instanceof Arrayable) { |
763 | 763 | return call_user_func_array([collect($value), $abstract], $arguments); |
764 | 764 | } |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | protected function callBuiltinDisplayer($abstract, $arguments) |
783 | 783 | { |
784 | 784 | if ($abstract instanceof Closure) { |
785 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
785 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
786 | 786 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
787 | 787 | }); |
788 | 788 | } |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $grid = $this->grid; |
792 | 792 | $column = $this; |
793 | 793 | |
794 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
794 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
795 | 795 | /** @var AbstractDisplayer $displayer */ |
796 | 796 | $displayer = new $abstract($value, $grid, $column, $this); |
797 | 797 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $show = $this->grid->visibleColumnNames(); |
48 | 48 | |
49 | - $lists = $this->getGridColumns()->map(function ($label, $key) use ($show) { |
|
49 | + $lists = $this->getGridColumns()->map(function($label, $key) use ($show) { |
|
50 | 50 | if (empty($show)) { |
51 | 51 | $checked = 'checked'; |
52 | 52 | } else { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function getGridColumns() |
100 | 100 | { |
101 | - return $this->grid->columns()->map(function (Grid\Column $column) { |
|
101 | + return $this->grid->columns()->map(function(Grid\Column $column) { |
|
102 | 102 | $name = $column->getName(); |
103 | 103 | |
104 | 104 | if ($this->isColumnIgnored($name)) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($item) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($item) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
19 | 19 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($name) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($name) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'red'); |
19 | 19 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * |
44 | 44 | * @param string $cast |
45 | 45 | * |
46 | - * @return Column|string |
|
46 | + * @return HasHeader |
|
47 | 47 | */ |
48 | 48 | protected function addSorter($cast = null) |
49 | 49 | { |
@@ -115,7 +115,7 @@ |
||
115 | 115 | */ |
116 | 116 | public function renderHeader() |
117 | 117 | { |
118 | - return collect($this->headers)->map(function ($item) { |
|
118 | + return collect($this->headers)->map(function($item) { |
|
119 | 119 | if ($item instanceof Renderable) { |
120 | 120 | return $item->render(); |
121 | 121 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | 'title' => $this->message, |
38 | 38 | ]; |
39 | 39 | |
40 | - $data = collect($data)->map(function ($val, $key) { |
|
40 | + $data = collect($data)->map(function($val, $key) { |
|
41 | 41 | return "data-{$key}=\"{$val}\""; |
42 | 42 | })->implode(' '); |
43 | 43 |