@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | /** |
140 | 140 | * Extend column displayer. |
141 | 141 | * |
142 | - * @param $name |
|
142 | + * @param string $name |
|
143 | 143 | * @param $displayer |
144 | 144 | */ |
145 | 145 | public static function extend($name, $displayer) |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | /** |
174 | 174 | * Set model for column. |
175 | 175 | * |
176 | - * @param $model |
|
176 | + * @param Model $model |
|
177 | 177 | */ |
178 | 178 | public function setModel($model) |
179 | 179 | { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Get original column value. |
259 | 259 | * |
260 | - * @return mixed |
|
260 | + * @return string |
|
261 | 261 | */ |
262 | 262 | public function getOriginal() |
263 | 263 | { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | /** |
268 | 268 | * Get name of this column. |
269 | 269 | * |
270 | - * @return mixed |
|
270 | + * @return string |
|
271 | 271 | */ |
272 | 272 | public function getName() |
273 | 273 | { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | /** |
296 | 296 | * Get label of the column. |
297 | 297 | * |
298 | - * @return mixed |
|
298 | + * @return string |
|
299 | 299 | */ |
300 | 300 | public function getLabel() |
301 | 301 | { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * Display using display abstract. |
397 | 397 | * |
398 | 398 | * @param string $abstract |
399 | - * @param array $arguments |
|
399 | + * @param Closure[] $arguments |
|
400 | 400 | * |
401 | 401 | * @return $this |
402 | 402 | */ |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | protected function isRelation() |
327 | 327 | { |
328 | - return (bool)$this->relation; |
|
328 | + return (bool) $this->relation; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -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,8 +535,8 @@ discard block |
||
535 | 535 | */ |
536 | 536 | public function loading($values = [], $others = []) |
537 | 537 | { |
538 | - return $this->display(function ($value) use ($values, $others) { |
|
539 | - $values = (array)$values; |
|
538 | + return $this->display(function($value) use ($values, $others) { |
|
539 | + $values = (array) $values; |
|
540 | 540 | |
541 | 541 | if (in_array($value, $values)) { |
542 | 542 | return '<i class="fa fa-refresh fa-spin text-primary"></i>'; |
@@ -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 |
@@ -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 @@ discard block |
||
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 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return $item->toHtml(); |
125 | 125 | } |
126 | 126 | |
127 | - return (string)$item; |
|
127 | + return (string) $item; |
|
128 | 128 | })->implode(''); |
129 | 129 | } |
130 | 130 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @param string $value |
30 | 30 | * |
31 | - * @param Model|null $model |
|
31 | + * @param Model $model |
|
32 | 32 | */ |
33 | 33 | public function addBinding($value, Model $model) |
34 | 34 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | if (in_array($this->type, ['date', 'time'])) { |
45 | - $method = 'where' . ucfirst($this->type); |
|
45 | + $method = 'where'.ucfirst($this->type); |
|
46 | 46 | $model->{$method}($this->getColumnName(), $value); |
47 | 47 | return; |
48 | 48 | } |
@@ -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 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | { |
78 | 78 | $value = $this->getFilterValue([]); |
79 | 79 | |
80 | - $lists = collect($this->options)->map(function ($label, $key) use ($value) { |
|
80 | + $lists = collect($this->options)->map(function($label, $key) use ($value) { |
|
81 | 81 | $checked = in_array($key, $value) ? 'checked' : ''; |
82 | 82 | |
83 | 83 | return <<<HTML |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function addBinding($value, Model $model) |
37 | 37 | { |
38 | - $value = array_filter((array)$value); |
|
38 | + $value = array_filter((array) $value); |
|
39 | 39 | |
40 | 40 | if (empty($value)) { |
41 | 41 | return; |