@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * Get or set option for grid. |
| 269 | 269 | * |
| 270 | 270 | * @param string $key |
| 271 | - * @param mixed $value |
|
| 271 | + * @param boolean $value |
|
| 272 | 272 | * |
| 273 | 273 | * @return $this|mixed |
| 274 | 274 | */ |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | /** |
| 454 | 454 | * Get the grid paginator. |
| 455 | 455 | * |
| 456 | - * @return mixed |
|
| 456 | + * @return Tools\Paginator |
|
| 457 | 457 | */ |
| 458 | 458 | public function paginator() |
| 459 | 459 | { |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | /** |
| 808 | 808 | * Dynamically add columns to the grid view. |
| 809 | 809 | * |
| 810 | - * @param $method |
|
| 810 | + * @param string $method |
|
| 811 | 811 | * @param $arguments |
| 812 | 812 | * |
| 813 | 813 | * @return Column |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $column = new Column($column, $label); |
| 358 | 358 | $column->setGrid($this); |
| 359 | 359 | |
| 360 | - return tap($column, function ($value) { |
|
| 360 | + return tap($column, function($value) { |
|
| 361 | 361 | $this->columns->push($value); |
| 362 | 362 | }); |
| 363 | 363 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $column = new Column($column, $label); |
| 422 | 422 | $column->setGrid($this); |
| 423 | 423 | |
| 424 | - return tap($column, function ($value) { |
|
| 424 | + return tap($column, function($value) { |
|
| 425 | 425 | $this->columns->prepend($value); |
| 426 | 426 | }); |
| 427 | 427 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | $data = $collection->toArray(); |
| 556 | 556 | |
| 557 | - $this->columns->map(function (Column $column) use (&$data) { |
|
| 557 | + $this->columns->map(function(Column $column) use (&$data) { |
|
| 558 | 558 | $data = $column->fill($data); |
| 559 | 559 | |
| 560 | 560 | $this->columnNames[] = $column->getName(); |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | */ |
| 575 | 575 | protected function buildRows(array $data) |
| 576 | 576 | { |
| 577 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
| 577 | + $this->rows = collect($data)->map(function($model, $number) { |
|
| 578 | 578 | return new Row($number, $model, $this->keyName); |
| 579 | 579 | }); |
| 580 | 580 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | /** |
| 25 | 25 | * Set grid action callback. |
| 26 | 26 | * |
| 27 | - * @param Closure|string $actions |
|
| 27 | + * @param Closure $actions |
|
| 28 | 28 | * |
| 29 | 29 | * @return $this |
| 30 | 30 | */ |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | public function batchActions(Closure $closure) |
| 90 | 90 | { |
| 91 | - $this->tools(function (Grid\Tools $tools) use ($closure) { |
|
| 91 | + $this->tools(function(Grid\Tools $tools) use ($closure) { |
|
| 92 | 92 | $tools->batch($closure); |
| 93 | 93 | }); |
| 94 | 94 | |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | { |
| 68 | 68 | Admin::script($this->script()); |
| 69 | 69 | |
| 70 | - $options = $this->getOptions()->map(function ($option) { |
|
| 70 | + $options = $this->getOptions()->map(function($option) { |
|
| 71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
| 72 | 72 | $url = \request()->fullUrlWithQuery([$this->perPageName => $option]); |
| 73 | 73 | |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | return []; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $selected = array_filter($selected, function ($value) { |
|
| 109 | + $selected = array_filter($selected, function($value) { |
|
| 110 | 110 | return !is_null($value); |
| 111 | 111 | }); |
| 112 | 112 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | * @param string $column |
| 58 | 58 | * @param string $label |
| 59 | 59 | * @param array $options |
| 60 | - * @param null $query |
|
| 60 | + * @param null|\Closure $query |
|
| 61 | 61 | * @param string $type |
| 62 | 62 | * |
| 63 | 63 | * @return $this |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | call_user_func($closure, $this->selector); |
| 28 | 28 | |
| 29 | - $this->header(function () { |
|
| 29 | + $this->header(function() { |
|
| 30 | 30 | return $this->renderSelector(); |
| 31 | 31 | }); |
| 32 | 32 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $active = Selector::parseSelected(); |
| 48 | 48 | |
| 49 | - $this->selector->getSelectors()->each(function ($selector, $column) use ($active) { |
|
| 49 | + $this->selector->getSelectors()->each(function($selector, $column) use ($active) { |
|
| 50 | 50 | if (!array_key_exists($column, $active)) { |
| 51 | 51 | return; |
| 52 | 52 | } |
@@ -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 | if (is_string($this->getColumn()->getOriginal()) || is_int($this->getColumn()->getOriginal())) { |
| 19 | 19 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * Set row model. |
| 42 | 42 | * |
| 43 | - * @param mixed $key |
|
| 43 | + * @param string $key |
|
| 44 | 44 | * |
| 45 | 45 | * @return \Illuminate\Database\Eloquent\Model|mixed |
| 46 | 46 | */ |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | public function style($style) |
| 121 | 121 | { |
| 122 | 122 | if (is_array($style)) { |
| 123 | - $style = implode(';', array_map(function ($key, $val) { |
|
| 123 | + $style = implode(';', array_map(function($key, $val) { |
|
| 124 | 124 | return "$key:$val"; |
| 125 | 125 | }, array_keys($style), array_values($style))); |
| 126 | 126 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function removeFilterByID($id) |
| 287 | 287 | { |
| 288 | - $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) { |
|
| 288 | + $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) { |
|
| 289 | 289 | return $filter->getId() != $id; |
| 290 | 290 | }); |
| 291 | 291 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | $inputs = Arr::dot(request()->all()); |
| 301 | 301 | |
| 302 | - $inputs = array_filter($inputs, function ($input) { |
|
| 302 | + $inputs = array_filter($inputs, function($input) { |
|
| 303 | 303 | return $input !== '' && !is_null($input); |
| 304 | 304 | }); |
| 305 | 305 | |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - return tap(array_filter($conditions), function ($conditions) { |
|
| 330 | + return tap(array_filter($conditions), function($conditions) { |
|
| 331 | 331 | if (!empty($conditions)) { |
| 332 | 332 | $this->expand(); |
| 333 | 333 | } |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | return $inputs; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
| 348 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
| 349 | 349 | return Str::startsWith($key, "{$this->name}_"); |
| 350 | - })->mapWithKeys(function ($val, $key) { |
|
| 350 | + })->mapWithKeys(function($val, $key) { |
|
| 351 | 351 | $key = str_replace("{$this->name}_", '', $key); |
| 352 | 352 | |
| 353 | 353 | return [$key => $val]; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | */ |
| 418 | 418 | public function scope($key, $label = '') |
| 419 | 419 | { |
| 420 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
| 420 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
| 421 | 421 | return $this->scopes->push($scope); |
| 422 | 422 | }); |
| 423 | 423 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | { |
| 442 | 442 | $key = request(Scope::QUERY_NAME); |
| 443 | 443 | |
| 444 | - return $this->scopes->first(function ($scope) use ($key) { |
|
| 444 | + return $this->scopes->first(function($scope) use ($key) { |
|
| 445 | 445 | return $scope->key == $key; |
| 446 | 446 | }); |
| 447 | 447 | } |
@@ -566,9 +566,9 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | $columns->push($pageKey); |
| 568 | 568 | |
| 569 | - $groupNames = collect($this->filters)->filter(function ($filter) { |
|
| 569 | + $groupNames = collect($this->filters)->filter(function($filter) { |
|
| 570 | 570 | return $filter instanceof Filter\Group; |
| 571 | - })->map(function (AbstractFilter $filter) { |
|
| 571 | + })->map(function(AbstractFilter $filter) { |
|
| 572 | 572 | return "{$filter->getId()}_group"; |
| 573 | 573 | }); |
| 574 | 574 | |