Completed
Pull Request — master (#3873)
by jxlwqq
10:46
created
src/Controllers/AuthController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $form = $this->settingForm();
97 97
         $form->tools(
98
-            function (Form\Tools $tools) {
98
+            function(Form\Tools $tools) {
99 99
                 $tools->disableList();
100 100
                 $tools->disableDelete();
101 101
                 $tools->disableView();
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $form->image('avatar', trans('admin.avatar'));
134 134
         $form->password('password', trans('admin.password'))->rules('confirmed|required');
135 135
         $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')
136
-            ->default(function ($form) {
136
+            ->default(function($form) {
137 137
                 return $form->model()->password;
138 138
             });
139 139
 
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 
142 142
         $form->ignore(['password_confirmation']);
143 143
 
144
-        $form->saving(function (Form $form) {
144
+        $form->saving(function(Form $form) {
145 145
             if ($form->password && $form->model()->password != $form->password) {
146 146
                 $form->password = bcrypt($form->password);
147 147
             }
148 148
         });
149 149
 
150
-        $form->saved(function () {
150
+        $form->saved(function() {
151 151
             admin_toastr(trans('admin.update_succeeded'));
152 152
 
153 153
             return redirect(admin_url('auth/setting'));
Please login to merge, or discard this patch.
src/Grid/Displayers/Label.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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');
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
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     public function removeFilterByID($id)
288 288
     {
289
-        $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) {
289
+        $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) {
290 290
             return $filter->getId() != $id;
291 291
         });
292 292
     }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     {
301 301
         $inputs = Arr::dot(Input::all());
302 302
 
303
-        $inputs = array_filter($inputs, function ($input) {
303
+        $inputs = array_filter($inputs, function($input) {
304 304
             return $input !== '' && !is_null($input);
305 305
         });
306 306
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             }
329 329
         }
330 330
 
331
-        return tap(array_filter($conditions), function ($conditions) {
331
+        return tap(array_filter($conditions), function($conditions) {
332 332
             if (!empty($conditions)) {
333 333
                 $this->expand();
334 334
             }
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
             return $inputs;
347 347
         }
348 348
 
349
-        $inputs = collect($inputs)->filter(function ($input, $key) {
349
+        $inputs = collect($inputs)->filter(function($input, $key) {
350 350
             return Str::startsWith($key, "{$this->name}_");
351
-        })->mapWithKeys(function ($val, $key) {
351
+        })->mapWithKeys(function($val, $key) {
352 352
             $key = str_replace("{$this->name}_", '', $key);
353 353
 
354 354
             return [$key => $val];
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      */
419 419
     public function scope($key, $label = '')
420 420
     {
421
-        return tap(new Scope($key, $label), function (Scope $scope) {
421
+        return tap(new Scope($key, $label), function(Scope $scope) {
422 422
             return $this->scopes->push($scope);
423 423
         });
424 424
     }
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     {
443 443
         $key = request(Scope::QUERY_NAME);
444 444
 
445
-        return $this->scopes->first(function ($scope) use ($key) {
445
+        return $this->scopes->first(function($scope) use ($key) {
446 446
             return $scope->key == $key;
447 447
         });
448 448
     }
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
 
568 568
         $columns->push($pageKey);
569 569
 
570
-        $groupNames = collect($this->filters)->filter(function ($filter) {
570
+        $groupNames = collect($this->filters)->filter(function($filter) {
571 571
             return $filter instanceof Filter\Group;
572
-        })->map(function (AbstractFilter $filter) {
572
+        })->map(function(AbstractFilter $filter) {
573 573
             return "{$filter->getId()}_group";
574 574
         });
575 575
 
Please login to merge, or discard this patch.
src/Grid/Column.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 
498 498
         $column = $this;
499 499
 
500
-        return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) {
500
+        return $this->display(function($value) use ($grid, $column, $abstract, $arguments) {
501 501
             /** @var AbstractDisplayer $displayer */
502 502
             $displayer = new $abstract($value, $grid, $column, $this);
503 503
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
      */
516 516
     public function using(array $values, $default = null)
517 517
     {
518
-        return $this->display(function ($value) use ($values, $default) {
518
+        return $this->display(function($value) use ($values, $default) {
519 519
             if (is_null($value)) {
520 520
                 return $default;
521 521
             }
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
      */
534 534
     public function replace(array $replacements)
535 535
     {
536
-        return $this->display(function ($value) use ($replacements) {
536
+        return $this->display(function($value) use ($replacements) {
537 537
             if (isset($replacements[$value])) {
538 538
                 return $replacements[$value];
539 539
             }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
      */
552 552
     public function view($view)
553 553
     {
554
-        return $this->display(function ($value) use ($view) {
554
+        return $this->display(function($value) use ($view) {
555 555
             $model = $this;
556 556
 
557 557
             return view($view, compact('model', 'value'))->render();
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
      */
592 592
     public function filesize()
593 593
     {
594
-        return $this->display(function ($value) {
594
+        return $this->display(function($value) {
595 595
             return file_size($value);
596 596
         });
597 597
     }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
      */
606 606
     public function gravatar($size = 30)
607 607
     {
608
-        return $this->display(function ($value) use ($size) {
608
+        return $this->display(function($value) use ($size) {
609 609
             $src = sprintf(
610 610
                 'https://www.gravatar.com/avatar/%s?s=%d',
611 611
                 md5(strtolower($value)),
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
      */
627 627
     public function loading($values = [], $others = [])
628 628
     {
629
-        return $this->display(function ($value) use ($values, $others) {
629
+        return $this->display(function($value) use ($values, $others) {
630 630
             $values = (array) $values;
631 631
 
632 632
             if (in_array($value, $values)) {
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
      */
648 648
     public function icon(array $setting, $default = '')
649 649
     {
650
-        return $this->display(function ($value) use ($setting, $default) {
650
+        return $this->display(function($value) use ($setting, $default) {
651 651
             $fa = '';
652 652
 
653 653
             if (isset($setting[$value])) {
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
             Carbon::setLocale($locale);
674 674
         }
675 675
 
676
-        return $this->display(function ($value) {
676
+        return $this->display(function($value) {
677 677
             return Carbon::parse($value)->diffForHumans();
678 678
         });
679 679
     }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
      */
688 688
     public function date($format)
689 689
     {
690
-        return $this->display(function ($value) use ($format) {
690
+        return $this->display(function($value) use ($format) {
691 691
             return date($format, strtotime($value));
692 692
         });
693 693
     }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
      */
703 703
     public function bool(array $map = [], $default = false)
704 704
     {
705
-        return $this->display(function ($value) use ($map, $default) {
705
+        return $this->display(function($value) use ($map, $default) {
706 706
             $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default);
707 707
 
708 708
             return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>';
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 
725 725
         $grid = $this->grid;
726 726
 
727
-        return $this->display(function ($_, $column) use ($action, $grid) {
727
+        return $this->display(function($_, $column) use ($action, $grid) {
728 728
             /** @var RowAction $action */
729 729
             $action = new $action();
730 730
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
      */
747 747
     public function dot($options = [], $default = '')
748 748
     {
749
-        return $this->prefix(function ($_, $original) use ($options, $default) {
749
+        return $this->prefix(function($_, $original) use ($options, $default) {
750 750
             if (is_null($original)) {
751 751
                 $style = $default;
752 752
             } else {
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
         $grid = $this->grid;
874 874
         $column = $this;
875 875
 
876
-        $this->display(function ($value) use ($grid, $column, $class) {
876
+        $this->display(function($value) use ($grid, $column, $class) {
877 877
             /** @var AbstractDisplayer $definition */
878 878
             $definition = new $class($value, $grid, $column, $this);
879 879
 
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
     protected function htmlEntityEncode($item)
892 892
     {
893 893
         if (is_array($item)) {
894
-            array_walk_recursive($item, function (&$value) {
894
+            array_walk_recursive($item, function(&$value) {
895 895
                 $value = htmlentities($value);
896 896
             });
897 897
         } else {
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
      */
929 929
     protected function callSupportDisplayer($abstract, $arguments)
930 930
     {
931
-        return $this->display(function ($value) use ($abstract, $arguments) {
931
+        return $this->display(function($value) use ($abstract, $arguments) {
932 932
             if (is_array($value) || $value instanceof Arrayable) {
933 933
                 return call_user_func_array([collect($value), $abstract], $arguments);
934 934
             }
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
     protected function callBuiltinDisplayer($abstract, $arguments)
953 953
     {
954 954
         if ($abstract instanceof Closure) {
955
-            return $this->display(function ($value) use ($abstract, $arguments) {
955
+            return $this->display(function($value) use ($abstract, $arguments) {
956 956
                 return $abstract->call($this, ...array_merge([$value], $arguments));
957 957
             });
958 958
         }
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
             $grid = $this->grid;
962 962
             $column = $this;
963 963
 
964
-            return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) {
964
+            return $this->display(function($value) use ($abstract, $grid, $column, $arguments) {
965 965
                 /** @var AbstractDisplayer $displayer */
966 966
                 $displayer = new $abstract($value, $grid, $column, $this);
967 967
 
Please login to merge, or discard this patch.