Completed
Pull Request — master (#4913)
by Song
07:48 queued 04:50
created
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.
src/Grid/Filter/AbstractFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -475,7 +475,7 @@
 block discarded – undo
475 475
         $relation = substr($this->column, 0, strrpos($this->column, '.'));
476 476
         $args[0] = last(explode('.', $this->column));
477 477
 
478
-        return ['whereHas' => [$relation, function ($relation) use ($args) {
478
+        return ['whereHas' => [$relation, function($relation) use ($args) {
479 479
             call_user_func_array([$relation, $this->query], $args);
480 480
         }]];
481 481
     }
Please login to merge, or discard this patch.
src/Controllers/MenuController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
         return $content
27 27
             ->title(trans('admin.menu'))
28 28
             ->description(trans('admin.list'))
29
-            ->row(function (Row $row) {
29
+            ->row(function(Row $row) {
30 30
                 $row->column(6, $this->treeView()->render());
31 31
 
32
-                $row->column(6, function (Column $column) {
32
+                $row->column(6, function(Column $column) {
33 33
                     $form = new \Encore\Admin\Widgets\Form();
34 34
                     $form->action(admin_url('auth/menu'));
35 35
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         $tree->disableCreate();
77 77
 
78
-        $tree->branch(function ($branch) {
78
+        $tree->branch(function($branch) {
79 79
             $payload = "<i class='fa {$branch['icon']}'></i>&nbsp;<strong>{$branch['title']}</strong>";
80 80
 
81 81
             if (!isset($branch['children'])) {
Please login to merge, or discard this patch.
src/Console/GenerateMenuCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function handle()
50 50
     {
51
-        $routes = collect($this->router->getRoutes())->filter(function (Route $route) {
51
+        $routes = collect($this->router->getRoutes())->filter(function(Route $route) {
52 52
             $uri = $route->uri();
53 53
             // built-in, parameterized and no-GET are ignored
54 54
             return Str::startsWith($uri, 'admin/')
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 && !Str::contains($uri, '{')
58 58
                 && in_array('GET', $route->methods());
59 59
         })
60
-            ->map(function (Route $route) {
60
+            ->map(function(Route $route) {
61 61
                 $uri = substr($route->uri(), strlen('admin/'));
62 62
 
63 63
                 return [
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $menus = Menu::all()->pluck('title', 'uri');
73 73
         // exclude exist ones
74
-        $news = $routes->diffKeys($menus)->map(function ($item, $key) {
74
+        $news = $routes->diffKeys($menus)->map(function($item, $key) {
75 75
             return [
76 76
                 'title' => $item,
77 77
                 'uri'   => $key,
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         } else {
86 86
             if ($this->hasOption('dry-run') && $this->option('dry-run')) {
87 87
                 $this->line('<info>The following menu items will be created</info>: ');
88
-                $this->table(['Title', 'Uri'], array_map(function ($item) {
88
+                $this->table(['Title', 'Uri'], array_map(function($item) {
89 89
                     return [
90 90
                         $item['title'],
91 91
                         $item['uri'],
Please login to merge, or discard this patch.
src/Form/Field/MultipleFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         // for create or update
156 156
         if ($this->pathColumn) {
157
-            $targets = array_map(function ($target) {
157
+            $targets = array_map(function($target) {
158 158
                 return [$this->pathColumn => $target];
159 159
             }, $targets);
160 160
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $this->name = $this->getStoreName($file);
187 187
 
188
-        return tap($this->upload($file), function () {
188
+        return tap($this->upload($file), function() {
189 189
             $this->name = null;
190 190
         });
191 191
     }
Please login to merge, or discard this patch.
src/Grid/Actions/Delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         ];
30 30
 
31 31
         try {
32
-            DB::transaction(function () use ($model) {
32
+            DB::transaction(function() use ($model) {
33 33
                 $model->delete();
34 34
             });
35 35
         } catch (\Exception $exception) {
Please login to merge, or discard this patch.
src/Show.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
         $this->overwriteExistingField($name);
228 228
 
229
-        return tap($field, function ($field) {
229
+        return tap($field, function($field) {
230 230
             $this->fields->push($field);
231 231
         });
232 232
     }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
         $this->overwriteExistingRelation($name);
250 250
 
251
-        return tap($relation, function ($relation) {
251
+        return tap($relation, function($relation) {
252 252
             $this->relations->push($relation);
253 253
         });
254 254
     }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         }
266 266
 
267 267
         $this->fields = $this->fields->filter(
268
-            function (Field $field) use ($name) {
268
+            function(Field $field) use ($name) {
269 269
                 return $field->getName() != $name;
270 270
             }
271 271
         );
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         }
284 284
 
285 285
         $this->relations = $this->relations->filter(
286
-            function (Relation $relation) use ($name) {
286
+            function(Relation $relation) use ($name) {
287 287
                 return $relation->getName() != $name;
288 288
             }
289 289
         );
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
342 342
     {
343
-        collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) {
343
+        collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) {
344 344
             $field->setWidth($fieldWidth, $labelWidth);
345 345
         });
346 346
 
Please login to merge, or discard this patch.