@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | /** |
| 126 | 126 | * Extend column displayer. |
| 127 | 127 | * |
| 128 | - * @param $name |
|
| 128 | + * @param string $name |
|
| 129 | 129 | * @param $displayer |
| 130 | 130 | */ |
| 131 | 131 | public static function extend($name, $displayer) |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * Set model for column. |
| 161 | 161 | * |
| 162 | - * @param $model |
|
| 162 | + * @param Model $model |
|
| 163 | 163 | */ |
| 164 | 164 | public function setModel($model) |
| 165 | 165 | { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** |
| 220 | 220 | * Get name of this column. |
| 221 | 221 | * |
| 222 | - * @return mixed |
|
| 222 | + * @return string |
|
| 223 | 223 | */ |
| 224 | 224 | public function getName() |
| 225 | 225 | { |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | /** |
| 230 | 230 | * Format label. |
| 231 | 231 | * |
| 232 | - * @param $label |
|
| 232 | + * @param string $label |
|
| 233 | 233 | * |
| 234 | 234 | * @return mixed |
| 235 | 235 | */ |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | /** |
| 244 | 244 | * Get label of the column. |
| 245 | 245 | * |
| 246 | - * @return mixed |
|
| 246 | + * @return string |
|
| 247 | 247 | */ |
| 248 | 248 | public function getLabel() |
| 249 | 249 | { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * Display using display abstract. |
| 307 | 307 | * |
| 308 | 308 | * @param string $abstract |
| 309 | - * @param array $arguments |
|
| 309 | + * @param Closure[] $arguments |
|
| 310 | 310 | * @return Column |
| 311 | 311 | */ |
| 312 | 312 | public function displayUsing($abstract, $arguments =[]) |
@@ -309,13 +309,13 @@ discard block |
||
| 309 | 309 | * @param array $arguments |
| 310 | 310 | * @return Column |
| 311 | 311 | */ |
| 312 | - public function displayUsing($abstract, $arguments =[]) |
|
| 312 | + public function displayUsing($abstract, $arguments = []) |
|
| 313 | 313 | { |
| 314 | 314 | $grid = $this->grid; |
| 315 | 315 | |
| 316 | 316 | $column = $this; |
| 317 | 317 | |
| 318 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
| 318 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
| 319 | 319 | /** @var AbstractDisplayer $displayer */ |
| 320 | 320 | $displayer = new $abstract($value, $grid, $column, $this); |
| 321 | 321 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function using(array $values, $default = null) |
| 335 | 335 | { |
| 336 | - return $this->display(function ($value) use ($values, $default) { |
|
| 336 | + return $this->display(function($value) use ($values, $default) { |
|
| 337 | 337 | if (is_null($value)) { |
| 338 | 338 | return $default; |
| 339 | 339 | } |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | public function view($view) |
| 353 | 353 | { |
| 354 | - return $this->display(function ($value) use ($view) { |
|
| 354 | + return $this->display(function($value) use ($view) { |
|
| 355 | 355 | $model = $this; |
| 356 | 356 | |
| 357 | 357 | return view($view, compact('model', 'value'))->render(); |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $grid = $this->grid; |
| 475 | 475 | $column = $this; |
| 476 | 476 | |
| 477 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
| 477 | + $this->display(function($value) use ($grid, $column, $class) { |
|
| 478 | 478 | /** @var AbstractDisplayer $definition */ |
| 479 | 479 | $definition = new $class($value, $grid, $column, $this); |
| 480 | 480 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | protected function htmlEntityEncode($item) |
| 493 | 493 | { |
| 494 | 494 | if (is_array($item)) { |
| 495 | - array_walk_recursive($item, function (&$value) { |
|
| 495 | + array_walk_recursive($item, function(&$value) { |
|
| 496 | 496 | $value = htmlentities($value); |
| 497 | 497 | }); |
| 498 | 498 | } else { |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | protected function callSupportDisplayer($abstract, $arguments) |
| 574 | 574 | { |
| 575 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 575 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 576 | 576 | if (is_array($value) || $value instanceof Arrayable) { |
| 577 | 577 | return call_user_func_array([collect($value), $abstract], $arguments); |
| 578 | 578 | } |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | protected function callBuiltinDisplayer($abstract, $arguments) |
| 597 | 597 | { |
| 598 | 598 | if ($abstract instanceof Closure) { |
| 599 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 599 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 600 | 600 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
| 601 | 601 | }); |
| 602 | 602 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $grid = $this->grid; |
| 606 | 606 | $column = $this; |
| 607 | 607 | |
| 608 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
| 608 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
| 609 | 609 | /** @var AbstractDisplayer $displayer */ |
| 610 | 610 | $displayer = new $abstract($value, $grid, $column, $this); |
| 611 | 611 | |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $column = new Column($column, $label); |
| 336 | 336 | $column->setGrid($this); |
| 337 | 337 | |
| 338 | - return tap($column, function ($value) { |
|
| 338 | + return tap($column, function($value) { |
|
| 339 | 339 | $this->columns->push($value); |
| 340 | 340 | }); |
| 341 | 341 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $column = new Column($column, $label); |
| 353 | 353 | $column->setGrid($this); |
| 354 | 354 | |
| 355 | - return tap($column, function ($value) { |
|
| 355 | + return tap($column, function($value) { |
|
| 356 | 356 | $this->columns->prepend($value); |
| 357 | 357 | }); |
| 358 | 358 | } |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | public function disableRowSelector() |
| 473 | 473 | { |
| 474 | - $this->tools(function ($tools) { |
|
| 474 | + $this->tools(function($tools) { |
|
| 475 | 475 | /* @var Grid\Tools $tools */ |
| 476 | 476 | $tools->disableBatchActions(); |
| 477 | 477 | }); |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | Column::setOriginalGridModels($collection); |
| 516 | 516 | |
| 517 | - $this->columns->map(function (Column $column) use (&$data) { |
|
| 517 | + $this->columns->map(function(Column $column) use (&$data) { |
|
| 518 | 518 | $data = $column->fill($data); |
| 519 | 519 | |
| 520 | 520 | $this->columnNames[] = $column->getName(); |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | */ |
| 611 | 611 | protected function buildRows(array $data) |
| 612 | 612 | { |
| 613 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
| 613 | + $this->rows = collect($data)->map(function($model, $number) { |
|
| 614 | 614 | return new Row($number, $model); |
| 615 | 615 | }); |
| 616 | 616 | |