Completed
Pull Request — master (#2575)
by
unknown
02:25
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
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     {
280 280
         $ids = explode(',', $id);
281 281
 
282
-        collect($ids)->filter()->each(function ($id) {
282
+        collect($ids)->filter()->each(function($id) {
283 283
             $this->deleteFiles($id);
284 284
             $this->model()->find($id)->delete();
285 285
         });
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
             ->with($this->getRelations())
305 305
             ->findOrFail($id)->toArray();
306 306
 
307
-        $this->builder->fields()->filter(function ($field) {
307
+        $this->builder->fields()->filter(function($field) {
308 308
             return $field instanceof Field\File;
309
-        })->each(function (Field\File $file) use ($data) {
309
+        })->each(function(Field\File $file) use ($data) {
310 310
             $file->setOriginal($data);
311 311
 
312 312
             $file->destroy();
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             return $response;
332 332
         }
333 333
 
334
-        $result = DB::transaction(function () {
334
+        $result = DB::transaction(function() {
335 335
             $inserts = $this->prepareInsert($this->updates);
336 336
 
337 337
             foreach ($inserts as $column => $value) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
             return $response;
525 525
         }
526 526
 
527
-        $result = DB::transaction(function () {
527
+        $result = DB::transaction(function() {
528 528
             $updates = $this->prepareUpdate($this->updates);
529 529
 
530 530
             foreach ($updates as $column => $value) {
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
     protected function getFieldByColumn($column)
984 984
     {
985 985
         return $this->builder->fields()->first(
986
-            function (Field $field) use ($column) {
986
+            function(Field $field) use ($column) {
987 987
                 if (is_array($field->column())) {
988 988
                     return in_array($column, $field->column());
989 989
                 }
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
         $values = $this->model->toArray();
1006 1006
 
1007
-        $this->builder->fields()->each(function (Field $field) use ($values) {
1007
+        $this->builder->fields()->each(function(Field $field) use ($values) {
1008 1008
             $field->setOriginal($values);
1009 1009
         });
1010 1010
     }
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 
1027 1027
         $data = $this->model->toArray();
1028 1028
 
1029
-        $this->builder->fields()->each(function (Field $field) use ($data) {
1029
+        $this->builder->fields()->each(function(Field $field) use ($data) {
1030 1030
             if (!in_array($field->column(), $this->ignored)) {
1031 1031
                 $field->fill($data);
1032 1032
             }
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
      */
1150 1150
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
1151 1151
     {
1152
-        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) {
1152
+        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) {
1153 1153
             /* @var Field $field  */
1154 1154
             $field->setWidth($fieldWidth, $labelWidth);
1155 1155
         });
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.