Completed
Pull Request — master (#5303)
by
unknown
03:28
created
src/Grid/Model.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
 
338 338
     /**
339
-     * @param     $callback
339
+     * @param     callable $callback
340 340
      * @param int $count
341 341
      *
342 342
      * @return LengthAwarePaginator|Collection
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     /**
492 492
      * Resolve perPage for pagination.
493 493
      *
494
-     * @param array|null $paginate
494
+     * @param Model $paginate
495 495
      *
496 496
      * @return array
497 497
      */
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
     /**
522 522
      * Find query by method name.
523 523
      *
524
-     * @param $method
524
+     * @param string $method
525 525
      *
526 526
      * @return static
527 527
      */
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 
676 676
     /**
677 677
      * @param string $method
678
-     * @param array  $arguments
678
+     * @param integer[]  $arguments
679 679
      *
680 680
      * @return $this
681 681
      */
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
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
 
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 
350 350
         $this->setSort();
351 351
 
352
-        $this->queries->reject(function ($query) {
352
+        $this->queries->reject(function($query) {
353 353
             return $query['method'] == 'paginate';
354
-        })->each(function ($query) {
354
+        })->each(function($query) {
355 355
             $this->model = $this->model->{$query['method']}(...$query['arguments']);
356 356
         });
357 357
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $this->setSort();
404 404
         $this->setPaginate();
405 405
 
406
-        $this->queries->unique()->each(function ($query) {
406
+        $this->queries->unique()->each(function($query) {
407 407
             $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']);
408 408
         });
409 409
 
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
 
434 434
         $queryBuilder = $this->originalModel;
435 435
 
436
-        $this->queries->reject(function ($query) {
436
+        $this->queries->reject(function($query) {
437 437
             return in_array($query['method'], ['get', 'paginate']);
438
-        })->each(function ($query) use (&$queryBuilder) {
438
+        })->each(function($query) use (&$queryBuilder) {
439 439
             $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']);
440 440
         });
441 441
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     {
470 470
         $paginate = $this->findQueryByMethod('paginate');
471 471
 
472
-        $this->queries = $this->queries->reject(function ($query) {
472
+        $this->queries = $this->queries->reject(function($query) {
473 473
             return $query['method'] == 'paginate';
474 474
         });
475 475
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
      */
528 528
     protected function findQueryByMethod($method)
529 529
     {
530
-        return $this->queries->first(function ($query) use ($method) {
530
+        return $this->queries->first(function($query) use ($method) {
531 531
             return $query['method'] == $method;
532 532
         });
533 533
     }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
         }
551 551
 
552 552
         $columnNameContainsDots = Str::contains($columnName, '.');
553
-        $isRelation = $this->queries->contains(function ($query) use ($columnName) {
553
+        $isRelation = $this->queries->contains(function($query) use ($columnName) {
554 554
             return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true);
555 555
         });
556 556
         if ($columnNameContainsDots === true && $isRelation) {
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
      */
595 595
     protected function setRelationSort($column)
596 596
     {
597
-        [ $relationName, $relationColumn ] = explode('.', $column);
597
+        [$relationName, $relationColumn] = explode('.', $column);
598 598
 
599
-        if ($this->queries->contains(function ($query) use ($relationName) {
599
+        if ($this->queries->contains(function($query) use ($relationName) {
600 600
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);
601 601
         })) {
602 602
             $relation = $this->model->$relationName();
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
      */
631 631
     public function resetOrderBy()
632 632
     {
633
-        $this->queries = $this->queries->reject(function ($query) {
633
+        $this->queries = $this->queries->reject(function($query) {
634 634
             return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc';
635 635
         });
636 636
     }
Please login to merge, or discard this patch.
src/Grid/Exporters/CsvExporter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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])) {
Please login to merge, or discard this patch.
src/Grid/Exporters/AbstractExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
             return $this;
140 140
         }
141 141
 
142
-        [ $scope, $args ] = explode(':', $scope);
142
+        [$scope, $args] = explode(':', $scope);
143 143
 
144 144
         if ($scope == Grid\Exporter::SCOPE_CURRENT_PAGE) {
145 145
             $this->grid->model()->usePaginate(true);
Please login to merge, or discard this patch.