Completed
Pull Request — master (#2576)
by jxlwqq
03:07
created
src/Grid/Tools.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function disableFilterButton()
87 87
     {
88
-        $this->tools = $this->tools->reject(function ($tool) {
88
+        $this->tools = $this->tools->reject(function($tool) {
89 89
             return $tool instanceof FilterButton;
90 90
         });
91 91
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public function disableRefreshButton()
99 99
     {
100
-        $this->tools = $this->tools->reject(function ($tool) {
100
+        $this->tools = $this->tools->reject(function($tool) {
101 101
             return $tool instanceof RefreshButton;
102 102
         });
103 103
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function disableBatchActions()
111 111
     {
112
-        $this->tools = $this->tools->reject(function ($tool) {
112
+        $this->tools = $this->tools->reject(function($tool) {
113 113
             return $tool instanceof BatchActions;
114 114
         });
115 115
     }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function batch(\Closure $closure)
121 121
     {
122
-        call_user_func($closure, $this->tools->first(function ($tool) {
122
+        call_user_func($closure, $this->tools->first(function($tool) {
123 123
             return $tool instanceof BatchActions;
124 124
         }));
125 125
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function render()
133 133
     {
134
-        return $this->tools->map(function ($tool) {
134
+        return $this->tools->map(function($tool) {
135 135
             if ($tool instanceof AbstractTool) {
136 136
                 return $tool->setGrid($this->grid)->render();
137 137
             }
Please login to merge, or discard this patch.
src/Console/AdminCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     protected function listAdminCommands()
58 58
     {
59
-        $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) {
59
+        $commands = collect(Artisan::all())->mapWithKeys(function($command, $key) {
60 60
             if (Str::startsWith($key, 'admin:')) {
61 61
                 return [$key => $command];
62 62
             }
Please login to merge, or discard this patch.
src/Form/Tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $all = $fields->toArray();
71 71
 
72 72
         foreach ($this->form->rows as $row) {
73
-            $rowFields = array_map(function ($field) {
73
+            $rowFields = array_map(function($field) {
74 74
                 return $field['element'];
75 75
             }, $row->getFields());
76 76
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function getTabs()
105 105
     {
106 106
         // If there is no active tab, then active the first.
107
-        if ($this->tabs->filter(function ($tab) {
107
+        if ($this->tabs->filter(function($tab) {
108 108
             return $tab['active'];
109 109
         })->isEmpty()) {
110 110
             $first = $this->tabs->first();
Please login to merge, or discard this patch.
src/Form.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
      *
266 266
      * @param $id
267 267
      *
268
-     * @return mixed
268
+     * @return boolean
269 269
      */
270 270
     public function destroy($id)
271 271
     {
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
      *
370 370
      * @param array $data
371 371
      *
372
-     * @return mixed
372
+     * @return Response|null
373 373
      */
374 374
     protected function prepare($data = [])
375 375
     {
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     /**
430 430
      * Call submitted callback.
431 431
      *
432
-     * @return mixed
432
+     * @return Response|null
433 433
      */
434 434
     protected function callSubmitted()
435 435
     {
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     /**
444 444
      * Call saving callback.
445 445
      *
446
-     * @return mixed
446
+     * @return Response|null
447 447
      */
448 448
     protected function callSaving()
449 449
     {
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     /**
458 458
      * Callback after saving a Model.
459 459
      *
460
-     * @return mixed|null
460
+     * @return Response|null
461 461
      */
462 462
     protected function callSaved()
463 463
     {
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
     /**
552 552
      * Get RedirectResponse after update.
553 553
      *
554
-     * @param mixed $key
554
+     * @param integer $key
555 555
      *
556 556
      * @return \Illuminate\Http\RedirectResponse
557 557
      */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     {
273 273
         $ids = explode(',', $id);
274 274
 
275
-        collect($ids)->filter()->each(function ($id) {
275
+        collect($ids)->filter()->each(function($id) {
276 276
             $this->deleteFiles($id);
277 277
             $this->model()->find($id)->delete();
278 278
         });
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
             ->with($this->getRelations())
298 298
             ->findOrFail($id)->toArray();
299 299
 
300
-        $this->builder->fields()->filter(function ($field) {
300
+        $this->builder->fields()->filter(function($field) {
301 301
             return $field instanceof Field\File;
302
-        })->each(function (Field\File $file) use ($data) {
302
+        })->each(function(Field\File $file) use ($data) {
303 303
             $file->setOriginal($data);
304 304
 
305 305
             $file->destroy();
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             return $response;
325 325
         }
326 326
 
327
-        DB::transaction(function () {
327
+        DB::transaction(function() {
328 328
             $inserts = $this->prepareInsert($this->updates);
329 329
 
330 330
             foreach ($inserts as $column => $value) {
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
             return $response;
516 516
         }
517 517
 
518
-        DB::transaction(function () {
518
+        DB::transaction(function() {
519 519
             $updates = $this->prepareUpdate($this->updates);
520 520
 
521 521
             foreach ($updates as $column => $value) {
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
     protected function getFieldByColumn($column)
951 951
     {
952 952
         return $this->builder->fields()->first(
953
-            function (Field $field) use ($column) {
953
+            function(Field $field) use ($column) {
954 954
                 if (is_array($field->column())) {
955 955
                     return in_array($column, $field->column());
956 956
                 }
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 
972 972
         $values = $this->model->toArray();
973 973
 
974
-        $this->builder->fields()->each(function (Field $field) use ($values) {
974
+        $this->builder->fields()->each(function(Field $field) use ($values) {
975 975
             $field->setOriginal($values);
976 976
         });
977 977
     }
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
 
994 994
         $data = $this->model->toArray();
995 995
 
996
-        $this->builder->fields()->each(function (Field $field) use ($data) {
996
+        $this->builder->fields()->each(function(Field $field) use ($data) {
997 997
             if (!in_array($field->column(), $this->ignored)) {
998 998
                 $field->fill($data);
999 999
             }
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
      */
1117 1117
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
1118 1118
     {
1119
-        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) {
1119
+        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) {
1120 1120
             /* @var Field $field  */
1121 1121
             $field->setWidth($fieldWidth, $labelWidth);
1122 1122
         });
Please login to merge, or discard this patch.
src/Grid.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         $callback = $this->actionsCallback;
432 432
         $column = $this->addColumn('__actions__', trans('admin.action'));
433 433
 
434
-        $column->display(function ($value) use ($grid, $column, $callback) {
434
+        $column->display(function($value) use ($grid, $column, $callback) {
435 435
             $actions = new Displayers\Actions($value, $grid, $column, $this);
436 436
 
437 437
             return $actions->display($callback);
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
      */
446 446
     public function disableRowSelector()
447 447
     {
448
-        $this->tools(function ($tools) {
448
+        $this->tools(function($tools) {
449 449
             /* @var Grid\Tools $tools */
450 450
             $tools->disableBatchActions();
451 451
         });
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
         $column = new Column(Column::SELECT_COLUMN_NAME, ' ');
470 470
         $column->setGrid($this);
471 471
 
472
-        $column->display(function ($value) use ($grid, $column) {
472
+        $column->display(function($value) use ($grid, $column) {
473 473
             $actions = new Displayers\RowSelector($value, $grid, $column, $this);
474 474
 
475 475
             return $actions->display();
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
         Column::setOriginalGridModels($collection);
500 500
 
501
-        $this->columns->map(function (Column $column) use (&$data) {
501
+        $this->columns->map(function(Column $column) use (&$data) {
502 502
             $data = $column->fill($data);
503 503
 
504 504
             $this->columnNames[] = $column->getName();
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      */
594 594
     protected function buildRows(array $data)
595 595
     {
596
-        $this->rows = collect($data)->map(function ($model, $number) {
596
+        $this->rows = collect($data)->map(function($model, $number) {
597 597
             return new Row($number, $model);
598 598
         });
599 599
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * Get or set option for grid.
231 231
      *
232 232
      * @param string $key
233
-     * @param mixed  $value
233
+     * @param boolean  $value
234 234
      *
235 235
      * @return $this|mixed
236 236
      */
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     /**
361 361
      * Get the grid paginator.
362 362
      *
363
-     * @return mixed
363
+     * @return Tools\Paginator
364 364
      */
365 365
     public function paginator()
366 366
     {
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
      *
548 548
      * @param bool $toArray
549 549
      *
550
-     * @return array|Collection|mixed
550
+     * @return Collection
551 551
      */
552 552
     public function processFilter($toArray = true)
553 553
     {
Please login to merge, or discard this patch.
src/Admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,10 +212,10 @@
 block discarded – undo
212 212
             'middleware' => config('admin.route.middleware'),
213 213
         ];
214 214
 
215
-        app('router')->group($attributes, function ($router) {
215
+        app('router')->group($attributes, function($router) {
216 216
 
217 217
             /* @var \Illuminate\Routing\Router $router */
218
-            $router->group([], function ($router) {
218
+            $router->group([], function($router) {
219 219
 
220 220
                 /* @var \Illuminate\Routing\Router $router */
221 221
                 $router->resource('auth/users', 'UserController');
Please login to merge, or discard this patch.
src/Grid/Filter/Layout/Column.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      */
74 74
     public function removeFilterByID($id)
75 75
     {
76
-        $this->filters = $this->filters->reject(function (AbstractFilter $filter) use ($id) {
76
+        $this->filters = $this->filters->reject(function(AbstractFilter $filter) use ($id) {
77 77
             return $filter->getId() == $id;
78 78
         });
79 79
     }
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
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     protected function removeFilterByID($id)
242 242
     {
243
-        $this->filters = array_filter($this->filters, function (AbstractFilter $filter) use ($id) {
243
+        $this->filters = array_filter($this->filters, function(AbstractFilter $filter) use ($id) {
244 244
             return $filter->getId() != $id;
245 245
         });
246 246
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     {
255 255
         $inputs = array_dot(Input::all());
256 256
 
257
-        $inputs = array_filter($inputs, function ($input) {
257
+        $inputs = array_filter($inputs, function($input) {
258 258
             return $input !== '' && !is_null($input);
259 259
         });
260 260
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             $conditions[] = $filter->condition($params);
279 279
         }
280 280
 
281
-        return tap(array_filter($conditions), function ($conditions) {
281
+        return tap(array_filter($conditions), function($conditions) {
282 282
             if (!empty($conditions)) {
283 283
                 $this->expand();
284 284
             }
@@ -296,9 +296,9 @@  discard block
 block discarded – undo
296 296
             return $inputs;
297 297
         }
298 298
 
299
-        $inputs = collect($inputs)->filter(function ($input, $key) {
299
+        $inputs = collect($inputs)->filter(function($input, $key) {
300 300
             return starts_with($key, "{$this->name}_");
301
-        })->mapWithKeys(function ($val, $key) {
301
+        })->mapWithKeys(function($val, $key) {
302 302
             $key = str_replace("{$this->name}_", '', $key);
303 303
 
304 304
             return [$key => $val];
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      */
352 352
     public function scope($key, $label = '')
353 353
     {
354
-        return tap(new Scope($key, $label), function (Scope $scope) {
354
+        return tap(new Scope($key, $label), function(Scope $scope) {
355 355
             return $this->scopes->push($scope);
356 356
         });
357 357
     }
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     {
376 376
         $key = request(Scope::QUERY_NAME);
377 377
 
378
-        return $this->scopes->first(function ($scope) use ($key) {
378
+        return $this->scopes->first(function($scope) use ($key) {
379 379
             return $scope->key == $key;
380 380
         });
381 381
     }
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 
496 496
         $columns->push($pageKey);
497 497
 
498
-        $groupNames = collect($this->filters)->filter(function ($filter) {
498
+        $groupNames = collect($this->filters)->filter(function($filter) {
499 499
             return $filter instanceof Group;
500
-        })->map(function (AbstractFilter $filter) {
500
+        })->map(function(AbstractFilter $filter) {
501 501
             return "{$filter->getId()}_group";
502 502
         });
503 503
 
Please login to merge, or discard this patch.
src/Middleware/LogOperation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             return true;
67 67
         }
68 68
 
69
-        return $allowedMethods->map(function ($method) {
69
+        return $allowedMethods->map(function($method) {
70 70
             return strtoupper($method);
71 71
         })->contains($method);
72 72
     }
Please login to merge, or discard this patch.