Completed
Push — master ( 9777e0...fe01b0 )
by Song
15:54 queued 03:15
created
src/Grid/Column.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         $name = $this->getName();
487 487
         $query = request()->query();
488 488
 
489
-        $this->prefix(function ($_, $original) use ($name, $query) {
489
+        $this->prefix(function($_, $original) use ($name, $query) {
490 490
             Arr::set($query, $name, $original);
491 491
 
492 492
             $url = request()->fullUrlWithQuery($query);
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 
540 540
         $column = $this;
541 541
 
542
-        return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) {
542
+        return $this->display(function($value) use ($grid, $column, $abstract, $arguments) {
543 543
             /** @var AbstractDisplayer $displayer */
544 544
             $displayer = new $abstract($value, $grid, $column, $this);
545 545
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
      */
558 558
     public function using(array $values, $default = null)
559 559
     {
560
-        return $this->display(function ($value) use ($values, $default) {
560
+        return $this->display(function($value) use ($values, $default) {
561 561
             if (is_null($value)) {
562 562
                 return $default;
563 563
             }
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
      */
576 576
     public function replace(array $replacements)
577 577
     {
578
-        return $this->display(function ($value) use ($replacements) {
578
+        return $this->display(function($value) use ($replacements) {
579 579
             if (isset($replacements[$value])) {
580 580
                 return $replacements[$value];
581 581
             }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      */
594 594
     public function view($view)
595 595
     {
596
-        return $this->display(function ($value) use ($view) {
596
+        return $this->display(function($value) use ($view) {
597 597
             $model = $this;
598 598
 
599 599
             return view($view, compact('model', 'value'))->render();
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
      */
634 634
     public function filesize()
635 635
     {
636
-        return $this->display(function ($value) {
636
+        return $this->display(function($value) {
637 637
             return file_size($value);
638 638
         });
639 639
     }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
      */
648 648
     public function gravatar($size = 30)
649 649
     {
650
-        return $this->display(function ($value) use ($size) {
650
+        return $this->display(function($value) use ($size) {
651 651
             $src = sprintf(
652 652
                 'https://www.gravatar.com/avatar/%s?s=%d',
653 653
                 md5(strtolower($value)),
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
      */
669 669
     public function loading($values = [], $others = [])
670 670
     {
671
-        return $this->display(function ($value) use ($values, $others) {
671
+        return $this->display(function($value) use ($values, $others) {
672 672
             $values = (array) $values;
673 673
 
674 674
             if (in_array($value, $values)) {
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
      */
690 690
     public function icon(array $setting, $default = '')
691 691
     {
692
-        return $this->display(function ($value) use ($setting, $default) {
692
+        return $this->display(function($value) use ($setting, $default) {
693 693
             $fa = '';
694 694
 
695 695
             if (isset($setting[$value])) {
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
             Carbon::setLocale($locale);
716 716
         }
717 717
 
718
-        return $this->display(function ($value) {
718
+        return $this->display(function($value) {
719 719
             return Carbon::parse($value)->diffForHumans();
720 720
         });
721 721
     }
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
      */
730 730
     public function date($format)
731 731
     {
732
-        return $this->display(function ($value) use ($format) {
732
+        return $this->display(function($value) use ($format) {
733 733
             return date($format, strtotime($value));
734 734
         });
735 735
     }
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
      */
745 745
     public function bool(array $map = [], $default = false)
746 746
     {
747
-        return $this->display(function ($value) use ($map, $default) {
747
+        return $this->display(function($value) use ($map, $default) {
748 748
             $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default);
749 749
 
750 750
             return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>';
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 
767 767
         $grid = $this->grid;
768 768
 
769
-        return $this->display(function ($_, $column) use ($action, $grid) {
769
+        return $this->display(function($_, $column) use ($action, $grid) {
770 770
             /** @var RowAction $action */
771 771
             $action = new $action();
772 772
 
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
      */
789 789
     public function dot($options = [], $default = '')
790 790
     {
791
-        return $this->prefix(function ($_, $original) use ($options, $default) {
791
+        return $this->prefix(function($_, $original) use ($options, $default) {
792 792
             if (is_null($original)) {
793 793
                 $style = $default;
794 794
             } else {
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         $grid = $this->grid;
916 916
         $column = $this;
917 917
 
918
-        $this->display(function ($value) use ($grid, $column, $class) {
918
+        $this->display(function($value) use ($grid, $column, $class) {
919 919
             /** @var AbstractDisplayer $definition */
920 920
             $definition = new $class($value, $grid, $column, $this);
921 921
 
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
     protected function htmlEntityEncode($item)
934 934
     {
935 935
         if (is_array($item)) {
936
-            array_walk_recursive($item, function (&$value) {
936
+            array_walk_recursive($item, function(&$value) {
937 937
                 $value = htmlentities($value);
938 938
             });
939 939
         } else {
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
      */
971 971
     protected function callSupportDisplayer($abstract, $arguments)
972 972
     {
973
-        return $this->display(function ($value) use ($abstract, $arguments) {
973
+        return $this->display(function($value) use ($abstract, $arguments) {
974 974
             if (is_array($value) || $value instanceof Arrayable) {
975 975
                 return call_user_func_array([collect($value), $abstract], $arguments);
976 976
             }
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
     protected function callBuiltinDisplayer($abstract, $arguments)
995 995
     {
996 996
         if ($abstract instanceof Closure) {
997
-            return $this->display(function ($value) use ($abstract, $arguments) {
997
+            return $this->display(function($value) use ($abstract, $arguments) {
998 998
                 return $abstract->call($this, ...array_merge([$value], $arguments));
999 999
             });
1000 1000
         }
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
             $grid = $this->grid;
1004 1004
             $column = $this;
1005 1005
 
1006
-            return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) {
1006
+            return $this->display(function($value) use ($abstract, $grid, $column, $arguments) {
1007 1007
                 /** @var AbstractDisplayer $displayer */
1008 1008
                 $displayer = new $abstract($value, $grid, $column, $this);
1009 1009
 
Please login to merge, or discard this patch.
src/Grid/Row.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Grid/Filter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@
 block discarded – undo
236 236
     public static function import()
237 237
     {
238 238
         $extension = static::getInstance();
239
-        DB::transaction(function () use ($extension) {
239
+        DB::transaction(function() use ($extension) {
240 240
             if ($menu = $extension->menu()) {
241 241
                 if ($extension->validateMenu($menu)) {
242 242
                     extract($menu);
Please login to merge, or discard this patch.
src/Form/Layout/Column.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      */
49 49
     public function removeFields($fields)
50 50
     {
51
-        $this->fields = $this->fields->reject(function (Field $field) use ($fields) {
51
+        $this->fields = $this->fields->reject(function(Field $field) use ($fields) {
52 52
             return in_array($field->column(), $fields);
53 53
         });
54 54
     }
Please login to merge, or discard this patch.
src/Console/CreateUserCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         if (empty($selectedOption)) {
43 43
             $selected = $this->choice('Please choose a role for the user', $selectedOption, null, null, true);
44 44
 
45
-            $roles = $roles->filter(function ($role) use ($selected) {
45
+            $roles = $roles->filter(function($role) use ($selected) {
46 46
                 return in_array($role->name, $selected);
47 47
             });
48 48
         }
Please login to merge, or discard this patch.
src/Form/Builder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      */
336 336
     public function field($name)
337 337
     {
338
-        return $this->fields()->first(function (Field $field) use ($name) {
338
+        return $this->fields()->first(function(Field $field) use ($name) {
339 339
             return $field->column() === $name;
340 340
         });
341 341
     }
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 
535 535
         $this->form->getLayout()->removeReservedFields($reservedColumns);
536 536
 
537
-        $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) {
537
+        $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) {
538 538
             return in_array($field->column(), $reservedColumns, true);
539 539
         });
540 540
     }
Please login to merge, or discard this patch.
src/Auth/Database/HasPermissions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
      */
113 113
     protected static function bootHasPermissions()
114 114
     {
115
-        static::deleting(function ($model) {
115
+        static::deleting(function($model) {
116 116
             $model->roles()->detach();
117 117
 
118 118
             $model->permissions()->detach();
Please login to merge, or discard this patch.
src/Grid/Model.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 
348 348
         $this->setSort();
349 349
 
350
-        $this->queries->reject(function ($query) {
350
+        $this->queries->reject(function($query) {
351 351
             return $query['method'] == 'paginate';
352
-        })->each(function ($query) {
352
+        })->each(function($query) {
353 353
             $this->model = $this->model->{$query['method']}(...$query['arguments']);
354 354
         });
355 355
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         $this->setSort();
401 401
         $this->setPaginate();
402 402
 
403
-        $this->queries->unique()->each(function ($query) {
403
+        $this->queries->unique()->each(function($query) {
404 404
             $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']);
405 405
         });
406 406
 
@@ -430,9 +430,9 @@  discard block
 block discarded – undo
430 430
 
431 431
         $queryBuilder = $this->originalModel;
432 432
 
433
-        $this->queries->reject(function ($query) {
433
+        $this->queries->reject(function($query) {
434 434
             return in_array($query['method'], ['get', 'paginate']);
435
-        })->each(function ($query) use (&$queryBuilder) {
435
+        })->each(function($query) use (&$queryBuilder) {
436 436
             $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']);
437 437
         });
438 438
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     {
467 467
         $paginate = $this->findQueryByMethod('paginate');
468 468
 
469
-        $this->queries = $this->queries->reject(function ($query) {
469
+        $this->queries = $this->queries->reject(function($query) {
470 470
             return $query['method'] == 'paginate';
471 471
         });
472 472
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
      */
525 525
     protected function findQueryByMethod($method)
526 526
     {
527
-        return $this->queries->first(function ($query) use ($method) {
527
+        return $this->queries->first(function($query) use ($method) {
528 528
             return $query['method'] == $method;
529 529
         });
530 530
     }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
         }
548 548
 
549 549
         $columnNameContainsDots = Str::contains($columnName, '.');
550
-        $isRelation = $this->queries->contains(function ($query) use ($columnName) {
550
+        $isRelation = $this->queries->contains(function($query) use ($columnName) {
551 551
             return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true);
552 552
         });
553 553
         if ($columnNameContainsDots === true && $isRelation) {
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
     {
594 594
         list($relationName, $relationColumn) = explode('.', $column);
595 595
 
596
-        if ($this->queries->contains(function ($query) use ($relationName) {
596
+        if ($this->queries->contains(function($query) use ($relationName) {
597 597
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);
598 598
         })) {
599 599
             $relation = $this->model->$relationName();
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
      */
628 628
     public function resetOrderBy()
629 629
     {
630
-        $this->queries = $this->queries->reject(function ($query) {
630
+        $this->queries = $this->queries->reject(function($query) {
631 631
             return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc';
632 632
         });
633 633
     }
Please login to merge, or discard this patch.