@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | call_user_func($this->callback, $this); |
158 | 158 | } |
159 | 159 | |
160 | - $response = function () { |
|
160 | + $response = function() { |
|
161 | 161 | $handle = fopen('php://output', 'w'); |
162 | 162 | $titles = []; |
163 | 163 | |
164 | - $this->chunkById(function ($collection) use ($handle, &$titles) { |
|
164 | + $this->chunkById(function($collection) use ($handle, &$titles) { |
|
165 | 165 | Column::setOriginalGridModels($collection); |
166 | 166 | |
167 | 167 | $original = $current = $collection->toArray(); |
168 | 168 | |
169 | - $this->grid->getColumns()->map(function (Column $column) use (&$current) { |
|
169 | + $this->grid->getColumns()->map(function(Column $column) use (&$current) { |
|
170 | 170 | $current = $column->fill($current); |
171 | 171 | $this->grid->columnNames[] = $column->getName(); |
172 | 172 | }); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | protected function getVisiableTitles() |
196 | 196 | { |
197 | 197 | $titles = $this->grid->visibleColumns() |
198 | - ->mapWithKeys(function (Column $column) { |
|
198 | + ->mapWithKeys(function(Column $column) { |
|
199 | 199 | $columnName = $column->getName(); |
200 | 200 | $columnTitle = $column->getLabel(); |
201 | 201 | if (isset($this->titleCallbacks[$columnName])) { |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
338 | - * @param $callback |
|
338 | + * @param callable $callback |
|
339 | 339 | * @param int $count |
340 | 340 | * |
341 | 341 | * @return LengthAwarePaginator|Collection |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | /** |
490 | 490 | * Resolve perPage for pagination. |
491 | 491 | * |
492 | - * @param array|null $paginate |
|
492 | + * @param Model $paginate |
|
493 | 493 | * |
494 | 494 | * @return array |
495 | 495 | */ |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * Find query by method name. |
521 | 521 | * |
522 | - * @param $method |
|
522 | + * @param string $method |
|
523 | 523 | * |
524 | 524 | * @return static |
525 | 525 | */ |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | |
674 | 674 | /** |
675 | 675 | * @param string $method |
676 | - * @param array $arguments |
|
676 | + * @param integer[] $arguments |
|
677 | 677 | * |
678 | 678 | * @return $this |
679 | 679 | */ |
@@ -325,9 +325,9 @@ discard block |
||
325 | 325 | |
326 | 326 | $this->setSort(); |
327 | 327 | |
328 | - $this->queries->reject(function ($query) { |
|
328 | + $this->queries->reject(function($query) { |
|
329 | 329 | return $query['method'] == 'paginate'; |
330 | - })->each(function ($query) { |
|
330 | + })->each(function($query) { |
|
331 | 331 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
332 | 332 | }); |
333 | 333 | |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | |
349 | 349 | $this->setSort(); |
350 | 350 | |
351 | - $this->queries->reject(function ($query) { |
|
351 | + $this->queries->reject(function($query) { |
|
352 | 352 | return $query['method'] == 'paginate'; |
353 | - })->each(function ($query) { |
|
353 | + })->each(function($query) { |
|
354 | 354 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
355 | 355 | }); |
356 | 356 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $this->setSort(); |
402 | 402 | $this->setPaginate(); |
403 | 403 | |
404 | - $this->queries->unique()->each(function ($query) { |
|
404 | + $this->queries->unique()->each(function($query) { |
|
405 | 405 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
406 | 406 | }); |
407 | 407 | |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | |
432 | 432 | $queryBuilder = $this->originalModel; |
433 | 433 | |
434 | - $this->queries->reject(function ($query) { |
|
434 | + $this->queries->reject(function($query) { |
|
435 | 435 | return in_array($query['method'], ['get', 'paginate']); |
436 | - })->each(function ($query) use (&$queryBuilder) { |
|
436 | + })->each(function($query) use (&$queryBuilder) { |
|
437 | 437 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
438 | 438 | }); |
439 | 439 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $paginate = $this->findQueryByMethod('paginate'); |
469 | 469 | |
470 | - $this->queries = $this->queries->reject(function ($query) { |
|
470 | + $this->queries = $this->queries->reject(function($query) { |
|
471 | 471 | return $query['method'] == 'paginate'; |
472 | 472 | }); |
473 | 473 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | */ |
526 | 526 | protected function findQueryByMethod($method) |
527 | 527 | { |
528 | - return $this->queries->first(function ($query) use ($method) { |
|
528 | + return $this->queries->first(function($query) use ($method) { |
|
529 | 529 | return $query['method'] == $method; |
530 | 530 | }); |
531 | 531 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | |
550 | 550 | $columnNameContainsDots = Str::contains($columnName, '.'); |
551 | - $isRelation = $this->queries->contains(function ($query) use ($columnName) { |
|
551 | + $isRelation = $this->queries->contains(function($query) use ($columnName) { |
|
552 | 552 | return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true); |
553 | 553 | }); |
554 | 554 | if ($columnNameContainsDots === true && $isRelation) { |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | { |
595 | 595 | list($relationName, $relationColumn) = explode('.', $column); |
596 | 596 | |
597 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
597 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
598 | 598 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
599 | 599 | })) { |
600 | 600 | $relation = $this->model->$relationName(); |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | */ |
629 | 629 | public function resetOrderBy() |
630 | 630 | { |
631 | - $this->queries = $this->queries->reject(function ($query) { |
|
631 | + $this->queries = $this->queries->reject(function($query) { |
|
632 | 632 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
633 | 633 | }); |
634 | 634 | } |