Completed
Pull Request — master (#4435)
by Muhlis
07:58
created
src/Grid/Displayers/DropdownActions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     {
110 110
         if ($disable) {
111 111
             array_delete($this->defaultClass, Show::class);
112
-        } elseif (! in_array(Show::class, $this->defaultClass)) {
112
+        } elseif (!in_array(Show::class, $this->defaultClass)) {
113 113
             array_push($this->defaultClass, Show::class);
114 114
         }
115 115
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         if ($disable) {
129 129
             array_delete($this->defaultClass, Delete::class);
130
-        } elseif (! in_array(Delete::class, $this->defaultClass)) {
130
+        } elseif (!in_array(Delete::class, $this->defaultClass)) {
131 131
             array_push($this->defaultClass, Delete::class);
132 132
         }
133 133
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     {
146 146
         if ($disable) {
147 147
             array_delete($this->defaultClass, Edit::class);
148
-        } elseif (! in_array(Edit::class, $this->defaultClass)) {
148
+        } elseif (!in_array(Edit::class, $this->defaultClass)) {
149 149
             array_push($this->defaultClass, Edit::class);
150 150
         }
151 151
 
Please login to merge, or discard this patch.
src/Grid/Displayers/Actions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         if ($disable) {
84 84
             array_delete($this->actions, 'view');
85
-        } elseif (! in_array('view', $this->actions)) {
85
+        } elseif (!in_array('view', $this->actions)) {
86 86
             array_push($this->actions, 'view');
87 87
         }
88 88
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         if ($disable) {
100 100
             array_delete($this->actions, 'delete');
101
-        } elseif (! in_array('delete', $this->actions)) {
101
+        } elseif (!in_array('delete', $this->actions)) {
102 102
             array_push($this->actions, 'delete');
103 103
         }
104 104
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         if ($disable) {
116 116
             array_delete($this->actions, 'edit');
117
-        } elseif (! in_array('edit', $this->actions)) {
117
+        } elseif (!in_array('edit', $this->actions)) {
118 118
             array_push($this->actions, 'edit');
119 119
         }
120 120
 
Please login to merge, or discard this patch.
src/Grid/Displayers/Orderable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function display()
10 10
     {
11
-        if (! trait_exists('\Spatie\EloquentSortable\SortableTrait')) {
11
+        if (!trait_exists('\Spatie\EloquentSortable\SortableTrait')) {
12 12
             throw new \Exception('To use orderable grid, please install package [spatie/eloquent-sortable] first.');
13 13
         }
14 14
 
Please login to merge, or discard this patch.
src/Grid/Displayers/Editable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -209,11 +209,11 @@
 block discarded – undo
209 209
             'data-value' => "{$this->value}",
210 210
         ];
211 211
 
212
-        if (! empty($this->attributes)) {
212
+        if (!empty($this->attributes)) {
213 213
             $attributes = array_merge($attributes, $this->attributes);
214 214
         }
215 215
 
216
-        $attributes = collect($attributes)->map(function ($attribute, $name) {
216
+        $attributes = collect($attributes)->map(function($attribute, $name) {
217 217
             return "$name='$attribute'";
218 218
         })->implode(' ');
219 219
 
Please login to merge, or discard this patch.
src/Grid/Displayers/SwitchGroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $this->updateStates($states);
25 25
 
26
-        if (! Arr::isAssoc($columns)) {
26
+        if (!Arr::isAssoc($columns)) {
27 27
             $labels = array_map('ucfirst', $columns);
28 28
 
29 29
             $columns = array_combine($columns, $labels);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         if ($keys->isEmpty()) {
47 47
             $key = $name;
48 48
         } else {
49
-            $key = $keys->shift().$keys->reduce(function ($carry, $val) {
49
+            $key = $keys->shift().$keys->reduce(function($carry, $val) {
50 50
                 return $carry."[$val]";
51 51
             });
52 52
         }
Please login to merge, or discard this patch.
src/Grid/Row.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function style($style)
121 121
     {
122 122
         if (is_array($style)) {
123
-            $style = implode(';', array_map(function ($key, $val) {
123
+            $style = implode(';', array_map(function($key, $val) {
124 124
                 return "$key:$val";
125 125
             }, array_keys($style), array_values($style)));
126 126
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             $value = $value->toJson();
199 199
         }
200 200
 
201
-        if (! is_null($value) && ! is_scalar($value)) {
201
+        if (!is_null($value) && !is_scalar($value)) {
202 202
             return sprintf('<pre>%s</pre>', var_export($value, true));
203 203
         }
204 204
 
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
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function disableFilterButton(bool $disable = true)
91 91
     {
92
-        $this->tools = $this->tools->map(function ($tool) use ($disable) {
92
+        $this->tools = $this->tools->map(function($tool) use ($disable) {
93 93
             if ($tool instanceof FilterButton) {
94 94
                 return $tool->disable($disable);
95 95
             }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function disableBatchActions(bool $disable = true)
119 119
     {
120
-        $this->tools = $this->tools->map(function ($tool) use ($disable) {
120
+        $this->tools = $this->tools->map(function($tool) use ($disable) {
121 121
             if ($tool instanceof BatchActions) {
122 122
                 return $tool->disable($disable);
123 123
             }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function batch(\Closure $closure)
133 133
     {
134
-        call_user_func($closure, $this->tools->first(function ($tool) {
134
+        call_user_func($closure, $this->tools->first(function($tool) {
135 135
             return $tool instanceof BatchActions;
136 136
         }));
137 137
     }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function render()
145 145
     {
146
-        return $this->tools->map(function ($tool) {
146
+        return $this->tools->map(function($tool) {
147 147
             if ($tool instanceof AbstractTool) {
148
-                if (! $tool->allowed()) {
148
+                if (!$tool->allowed()) {
149 149
                     return '';
150 150
                 }
151 151
 
Please login to merge, or discard this patch.
src/Middleware/Permission.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             return $next($request);
30 30
         }
31 31
 
32
-        if (! Admin::user() || ! empty($args) || $this->shouldPassThrough($request)) {
32
+        if (!Admin::user() || !empty($args) || $this->shouldPassThrough($request)) {
33 33
             return $next($request);
34 34
         }
35 35
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             return $next($request);
38 38
         }
39 39
 
40
-        if (! Admin::user()->allPermissions()->first(function ($permission) use ($request) {
40
+        if (!Admin::user()->allPermissions()->first(function($permission) use ($request) {
41 41
             return $permission->shouldPassThrough($request);
42 42
         })) {
43 43
             Checker::error();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function checkRoutePermission(Request $request)
58 58
     {
59
-        if (! $middleware = collect($request->route()->middleware())->first(function ($middleware) {
59
+        if (!$middleware = collect($request->route()->middleware())->first(function($middleware) {
60 60
             return Str::startsWith($middleware, $this->middlewarePrefix);
61 61
         })) {
62 62
             return false;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         $method = array_shift($args);
68 68
 
69
-        if (! method_exists(Checker::class, $method)) {
69
+        if (!method_exists(Checker::class, $method)) {
70 70
             throw new \InvalidArgumentException("Invalid permission method [$method].");
71 71
         }
72 72
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         return collect($excepts)
93 93
             ->map('admin_base_path')
94
-            ->contains(function ($except) use ($request) {
94
+            ->contains(function($except) use ($request) {
95 95
                 if ($except !== '/') {
96 96
                     $except = trim($except, '/');
97 97
                 }
Please login to merge, or discard this patch.
src/Middleware/LogOperation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     protected function shouldLogOperation(Request $request)
47 47
     {
48 48
         return config('admin.operation_log.enable')
49
-            && ! $this->inExceptArray($request)
49
+            && !$this->inExceptArray($request)
50 50
             && $this->inAllowedMethods($request->method())
51 51
             && Admin::user();
52 52
     }
@@ -66,7 +66,7 @@  discard block
 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.