Completed
Pull Request — master (#1350)
by
unknown
02:38
created
src/Admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -235,10 +235,10 @@
 block discarded – undo
235 235
             'middleware' => config('admin.route.middleware'),
236 236
         ];
237 237
 
238
-        Route::group($attributes, function ($router) {
238
+        Route::group($attributes, function($router) {
239 239
 
240 240
             /* @var \Illuminate\Routing\Router $router */
241
-            $router->group([], function ($router) {
241
+            $router->group([], function($router) {
242 242
 
243 243
                 /* @var \Illuminate\Routing\Router $router */
244 244
                 $router->resource('auth/users', 'UserController');
Please login to merge, or discard this patch.
src/Form/Field/Select.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      *
39 39
      * @param array|callable|string $options
40 40
      *
41
-     * @return $this|mixed
41
+     * @return Select
42 42
      */
43 43
     public function options($options = [])
44 44
     {
Please login to merge, or discard this patch.
resources/views/partials/error.blade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 @if(Session::has('error'))
2
-    <?php $error = Session::get('error');?>
2
+    <?php $error = Session::get('error'); ?>
3 3
     <div class="alert alert-danger alert-dismissable">
4 4
         <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
5 5
         <h4><i class="icon fa fa-ban"></i>{{ array_get($error->get('title'), 0) }}</h4>
6 6
         <p>{!!  array_get($error->get('message'), 0) !!}</p>
7 7
     </div>
8 8
 @elseif (Session::has('errors'))
9
-    <?php $errors = Session::get('errors');?>
9
+    <?php $errors = Session::get('errors'); ?>
10 10
     @if ($errors->hasBag('error'))
11 11
       <div class="alert alert-danger alert-dismissable">
12 12
 
Please login to merge, or discard this patch.
src/Middleware/Permission.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             return $next($request);
34 34
         }
35 35
 
36
-        if (!Admin::user()->allPermissions()->first(function ($permission) use ($request) {
36
+        if (!Admin::user()->allPermissions()->first(function($permission) use ($request) {
37 37
             return $permission->shouldPassThrough($request);
38 38
         })) {
39 39
             Checker::error();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function checkRoutePermission(Request $request)
54 54
     {
55
-        if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) {
55
+        if (!$middleware = collect($request->route()->middleware())->first(function($middleware) {
56 56
             return Str::startsWith($middleware, $this->middlewarePrefix);
57 57
         })) {
58 58
             return false;
Please login to merge, or discard this patch.
src/Auth/Database/Role.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
     {
87 87
         parent::boot();
88 88
 
89
-        static::deleting(function ($model) {
89
+        static::deleting(function($model) {
90 90
             $model->administrators()->detach();
91 91
 
92 92
             $model->permissions()->detach();
Please login to merge, or discard this patch.
src/Auth/Database/Permission.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         $method = $this->http_method;
68 68
 
69
-        $matches = array_map(function ($path) use ($method) {
69
+        $matches = array_map(function($path) use ($method) {
70 70
             $path = trim(config('admin.route.prefix'), '/').$path;
71 71
 
72 72
             if (Str::contains($path, ':')) {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             return false;
101 101
         }
102 102
 
103
-        $method = collect($match['method'])->filter()->map(function ($method) {
103
+        $method = collect($match['method'])->filter()->map(function($method) {
104 104
             return strtoupper($method);
105 105
         });
106 106
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         parent::boot();
142 142
 
143
-        static::deleting(function ($model) {
143
+        static::deleting(function($model) {
144 144
             $model->roles()->detach();
145 145
         });
146 146
     }
Please login to merge, or discard this patch.
src/Auth/Database/Menu.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
     {
77 77
         parent::boot();
78 78
 
79
-        static::deleting(function ($model) {
79
+        static::deleting(function($model) {
80 80
             $model->roles()->detach();
81 81
         });
82 82
     }
Please login to merge, or discard this patch.
src/Grid.php 4 patches
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      * Get or set option for grid.
230 230
      *
231 231
      * @param string $key
232
-     * @param mixed  $value
232
+     * @param boolean  $value
233 233
      *
234 234
      * @return $this|mixed
235 235
      */
@@ -286,6 +286,9 @@  discard block
 block discarded – undo
286 286
         return $column;
287 287
     }
288 288
 
289
+    /**
290
+     * @return string
291
+     */
289 292
     public function setLabel($label , $relationColumn)
290 293
     {
291 294
         $trans_key = 'validation.attributes.' . $relationColumn;
@@ -374,7 +377,7 @@  discard block
 block discarded – undo
374 377
     /**
375 378
      * Get the grid paginator.
376 379
      *
377
-     * @return mixed
380
+     * @return Tools\Paginator
378 381
      */
379 382
     public function paginator()
380 383
     {
@@ -750,7 +753,7 @@  discard block
 block discarded – undo
750 753
      *
751 754
      * @param Closure|null $closure
752 755
      *
753
-     * @return $this|Tools\Footer
756
+     * @return callable
754 757
      */
755 758
     public function footer(Closure $closure = null)
756 759
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -290,14 +290,14 @@
 block discarded – undo
290 290
     {
291 291
         $trans_key = 'validation.attributes.' . $relationColumn;
292 292
         $trans_key_low = strtolower($trans_key);
293
-         if (empty($label) && Lang::has($trans_key)) {
294
-             $label = Lang::get($trans_key);
295
-         }
296
-         if (empty($label) && Lang::has($trans_key_low)) {
293
+            if (empty($label) && Lang::has($trans_key)) {
294
+                $label = Lang::get($trans_key);
295
+            }
296
+            if (empty($label) && Lang::has($trans_key_low)) {
297 297
             $label = Lang::get($trans_key_low);
298 298
         }else if (empty($label)) {
299
-             $label = ucfirst($relationColumn);
300
-         }
299
+                $label = ucfirst($relationColumn);
300
+            }
301 301
         return $label;
302 302
     }
303 303
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
             $relation = $this->model()->eloquent()->$relationName();
273 273
 
274
-            $label = $this->setLabel($label,$relationColumn);
274
+            $label = $this->setLabel($label, $relationColumn);
275 275
 //            $label = empty($label) ? ucfirst($relationColumn) : $label;
276 276
             $name = snake_case($relationName).'.'.$relationColumn;
277 277
         }
@@ -286,16 +286,16 @@  discard block
 block discarded – undo
286 286
         return $column;
287 287
     }
288 288
 
289
-    public function setLabel($label , $relationColumn)
289
+    public function setLabel($label, $relationColumn)
290 290
     {
291
-        $trans_key = 'validation.attributes.' . $relationColumn;
291
+        $trans_key = 'validation.attributes.'.$relationColumn;
292 292
         $trans_key_low = strtolower($trans_key);
293 293
          if (empty($label) && Lang::has($trans_key)) {
294 294
              $label = Lang::get($trans_key);
295 295
          }
296 296
          if (empty($label) && Lang::has($trans_key_low)) {
297 297
             $label = Lang::get($trans_key_low);
298
-        }else if (empty($label)) {
298
+        } else if (empty($label)) {
299 299
              $label = ucfirst($relationColumn);
300 300
          }
301 301
         return $label;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         $callback = $this->actionsCallback;
455 455
         $column = $this->addColumn('__actions__', trans('admin.action'));
456 456
 
457
-        $column->display(function ($value) use ($grid, $column, $callback) {
457
+        $column->display(function($value) use ($grid, $column, $callback) {
458 458
             $actions = new Actions($value, $grid, $column, $this);
459 459
 
460 460
             return $actions->display($callback);
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
      */
469 469
     public function disableRowSelector()
470 470
     {
471
-        $this->tools(function ($tools) {
471
+        $this->tools(function($tools) {
472 472
             /* @var Grid\Tools $tools */
473 473
             $tools->disableBatchActions();
474 474
         });
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
         $column = new Column(Column::SELECT_COLUMN_NAME, ' ');
493 493
         $column->setGrid($this);
494 494
 
495
-        $column->display(function ($value) use ($grid, $column) {
495
+        $column->display(function($value) use ($grid, $column) {
496 496
             $actions = new RowSelector($value, $grid, $column, $this);
497 497
 
498 498
             return $actions->display();
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
         Column::setOriginalGridData($data);
521 521
 
522
-        $this->columns->map(function (Column $column) use (&$data) {
522
+        $this->columns->map(function(Column $column) use (&$data) {
523 523
             $data = $column->fill($data);
524 524
 
525 525
             $this->columnNames[] = $column->getName();
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
      */
598 598
     protected function buildRows(array $data)
599 599
     {
600
-        $this->rows = collect($data)->map(function ($model, $number) {
600
+        $this->rows = collect($data)->map(function($model, $number) {
601 601
             return new Row($number, $model);
602 602
         });
603 603
 
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
     public function __call($method, $arguments)
896 896
     {
897 897
         $label = isset($arguments[0]) ? $arguments[0] : null;
898
-        $label = $this->setLabel($label,$method);
898
+        $label = $this->setLabel($label, $method);
899 899
 
900 900
         if ($this->model()->eloquent() instanceof MongodbModel) {
901 901
             return $this->addColumn($method, $label);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@
 block discarded – undo
295 295
          }
296 296
          if (empty($label) && Lang::has($trans_key_low)) {
297 297
             $label = Lang::get($trans_key_low);
298
-        }else if (empty($label)) {
298
+        } else if (empty($label)) {
299 299
              $label = ucfirst($relationColumn);
300 300
          }
301 301
         return $label;
Please login to merge, or discard this patch.
src/Grid/Filter/AbstractFilter.php 3 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,6 +106,10 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $this->setPresenter(new Text($this->label));
108 108
     }
109
+
110
+    /**
111
+     * @param string $label
112
+     */
109 113
     public function setLabel($label)
110 114
     {
111 115
         $trans_key = 'validation.attributes.' . $label;
@@ -350,7 +354,7 @@  discard block
 block discarded – undo
350 354
      *
351 355
      * @param Presenter $presenter
352 356
      *
353
-     * @return mixed
357
+     * @return Presenter
354 358
      */
355 359
     protected function setPresenter(Presenter $presenter)
356 360
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
     }
109 109
     public function setLabel($label)
110 110
     {
111
-        $trans_key = 'validation.attributes.' . $label;
111
+        $trans_key = 'validation.attributes.'.$label;
112 112
         $trans_key_low = strtolower($trans_key);
113 113
         if (Lang::has($trans_key)) {
114 114
             $label = Lang::get($trans_key);
115 115
         }
116 116
         if (Lang::has($trans_key_low)) {
117 117
             $label = Lang::get($trans_key_low);
118
-        }else {
118
+        } else {
119 119
             $label = ucfirst($label);
120 120
         }
121 121
         return $label;
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 
443 443
         list($relation, $args[0]) = explode('.', $this->column);
444 444
 
445
-        return ['whereHas' => [$relation, function ($relation) use ($args) {
445
+        return ['whereHas' => [$relation, function($relation) use ($args) {
446 446
             call_user_func_array([$relation, $this->query], $args);
447 447
         }]];
448 448
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -558,7 +558,7 @@
 block discarded – undo
558 558
         }
559 559
         if (Lang::has($trans_key_low)) {
560 560
             $label = Lang::get($trans_key_low);
561
-        }else {
561
+        } else {
562 562
             $label = ucfirst($label);
563 563
         }
564 564
         return $label;
Please login to merge, or discard this patch.