Completed
Pull Request — master (#2473)
by jxlwqq
02:37
created
src/Console/ResetPasswordCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         askForUserName:
32 32
         $username = $this->askWithCompletion('Please enter a username who needs to reset his password', $users->pluck('username')->toArray());
33 33
 
34
-        $user = $users->first(function ($user) use ($username) {
34
+        $user = $users->first(function($user) use ($username) {
35 35
             return $user->username == $username;
36 36
         });
37 37
 
Please login to merge, or discard this patch.
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/Grid/Filter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     {
226 226
         $inputs = array_dot(Input::all());
227 227
 
228
-        $inputs = array_filter($inputs, function ($input) {
228
+        $inputs = array_filter($inputs, function($input) {
229 229
             return $input !== '' && !is_null($input);
230 230
         });
231 231
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
             $conditions[] = $filter->condition($params);
250 250
         }
251 251
 
252
-        return tap(array_filter($conditions), function ($conditions) {
252
+        return tap(array_filter($conditions), function($conditions) {
253 253
             if (!empty($conditions)) {
254 254
                 $this->expand();
255 255
             }
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
             return $inputs;
268 268
         }
269 269
 
270
-        $inputs = collect($inputs)->filter(function ($input, $key) {
270
+        $inputs = collect($inputs)->filter(function($input, $key) {
271 271
             return starts_with($key, "{$this->name}_");
272
-        })->mapWithKeys(function ($val, $key) {
272
+        })->mapWithKeys(function($val, $key) {
273 273
             $key = str_replace("{$this->name}_", '', $key);
274 274
 
275 275
             return [$key => $val];
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public function scope($key, $label = '')
324 324
     {
325
-        return tap(new Scope($key, $label), function (Scope $scope) {
325
+        return tap(new Scope($key, $label), function(Scope $scope) {
326 326
             return $this->scopes->push($scope);
327 327
         });
328 328
     }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
     {
347 347
         $key = request(Scope::QUERY_NAME);
348 348
 
349
-        return $this->scopes->first(function ($scope) use ($key) {
349
+        return $this->scopes->first(function($scope) use ($key) {
350 350
             return $scope->key == $key;
351 351
         });
352 352
     }
@@ -461,9 +461,9 @@  discard block
 block discarded – undo
461 461
 
462 462
         $columns->push($pageKey);
463 463
 
464
-        $groupNames = collect($this->filters)->filter(function ($filter) {
464
+        $groupNames = collect($this->filters)->filter(function($filter) {
465 465
             return $filter instanceof Group;
466
-        })->map(function (AbstractFilter $filter) {
466
+        })->map(function(AbstractFilter $filter) {
467 467
             return "{$filter->getId()}_group";
468 468
         });
469 469
 
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   +10 added lines, -10 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
-        DB::transaction(function () {
334
+        DB::transaction(function() {
335 335
             $inserts = $this->prepareInsert($this->updates);
336 336
 
337 337
             foreach ($inserts as $column => $value) {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
             return $response;
523 523
         }
524 524
 
525
-        DB::transaction(function () {
525
+        DB::transaction(function() {
526 526
             $updates = $this->prepareUpdate($this->updates);
527 527
 
528 528
             foreach ($updates as $column => $value) {
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
                     $parent->save();
737 737
 
738 738
                     // When in creating, associate two models
739
-                    if (! $this->model->{$relation->getForeignKey()}) {
739
+                    if (!$this->model->{$relation->getForeignKey()}) {
740 740
                         $this->model->{$relation->getForeignKey()} = $parent->getKey();
741 741
 
742 742
                         $this->model->save();
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
     protected function getFieldByColumn($column)
980 980
     {
981 981
         return $this->builder->fields()->first(
982
-            function (Field $field) use ($column) {
982
+            function(Field $field) use ($column) {
983 983
                 if (is_array($field->column())) {
984 984
                     return in_array($column, $field->column());
985 985
                 }
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 
1001 1001
         $values = $this->model->toArray();
1002 1002
 
1003
-        $this->builder->fields()->each(function (Field $field) use ($values) {
1003
+        $this->builder->fields()->each(function(Field $field) use ($values) {
1004 1004
             $field->setOriginal($values);
1005 1005
         });
1006 1006
     }
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
         $data = $this->model->toArray();
1024 1024
 
1025
-        $this->builder->fields()->each(function (Field $field) use ($data) {
1025
+        $this->builder->fields()->each(function(Field $field) use ($data) {
1026 1026
             if (!in_array($field->column(), $this->ignored)) {
1027 1027
                 $field->fill($data);
1028 1028
             }
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
      */
1146 1146
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
1147 1147
     {
1148
-        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) {
1148
+        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) {
1149 1149
             /* @var Field $field  */
1150 1150
             $field->setWidth($fieldWidth, $labelWidth);
1151 1151
         });
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
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      * Get or set option for grid.
222 222
      *
223 223
      * @param string $key
224
-     * @param mixed  $value
224
+     * @param boolean  $value
225 225
      *
226 226
      * @return $this|mixed
227 227
      */
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     /**
352 352
      * Get the grid paginator.
353 353
      *
354
-     * @return mixed
354
+     * @return Tools\Paginator
355 355
      */
356 356
     public function paginator()
357 357
     {
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
      * Process the grid filter.
538 538
      *
539 539
      * @param bool $toArray
540
-     * @return array|Collection|mixed
540
+     * @return Collection
541 541
      */
542 542
     public function processFilter($toArray = true)
543 543
     {
Please login to merge, or discard this patch.