Completed
Pull Request — master (#2287)
by
unknown
02:52
created
src/Grid/Filter/Scope.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
      */
56 56
     public function condition()
57 57
     {
58
-        return $this->queries->map(function ($query) {
58
+        return $this->queries->map(function($query) {
59 59
             return [$query['method'] => $query['arguments']];
60 60
         })->toArray();
61 61
     }
Please login to merge, or discard this patch.
src/Form/Tools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@
 block discarded – undo
288 288
             return '';
289 289
         }
290 290
 
291
-        return $tools->map(function ($tool) {
291
+        return $tools->map(function($tool) {
292 292
             if ($tool instanceof Renderable) {
293 293
                 return $tool->render();
294 294
             }
Please login to merge, or discard this patch.
src/Show/Tools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
      */
276 276
     protected function renderCustomTools($tools)
277 277
     {
278
-        return $tools->map(function ($tool) {
278
+        return $tools->map(function($tool) {
279 279
             if ($tool instanceof Renderable) {
280 280
                 return $tool->render();
281 281
             }
Please login to merge, or discard this patch.
src/Form.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
         $data = $this->model->with($this->getRelations())
307 307
             ->findOrFail($id)->toArray();
308 308
 
309
-        $this->builder->fields()->filter(function ($field) {
309
+        $this->builder->fields()->filter(function($field) {
310 310
             return $field instanceof Field\File;
311
-        })->each(function (File $file) use ($data) {
311
+        })->each(function(File $file) use ($data) {
312 312
             $file->setOriginal($data);
313 313
 
314 314
             $file->destroy();
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             return $response;
334 334
         }
335 335
 
336
-        DB::transaction(function () {
336
+        DB::transaction(function() {
337 337
             $inserts = $this->prepareInsert($this->updates);
338 338
 
339 339
             foreach ($inserts as $column => $value) {
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             return $response;
521 521
         }
522 522
 
523
-        DB::transaction(function () {
523
+        DB::transaction(function() {
524 524
             $updates = $this->prepareUpdate($this->updates);
525 525
 
526 526
             foreach ($updates as $column => $value) {
@@ -582,10 +582,10 @@  discard block
 block discarded – undo
582 582
     {
583 583
         if (request('after-save') == 1) {
584 584
             // continue editing
585
-            $url = rtrim($resourcesPath, '/') . "/{$key}/edit";
585
+            $url = rtrim($resourcesPath, '/')."/{$key}/edit";
586 586
         } elseif (request('after-save') == 2) {
587 587
             // view resource
588
-            $url = rtrim($resourcesPath, '/') . "/{$key}";
588
+            $url = rtrim($resourcesPath, '/')."/{$key}";
589 589
         } else {
590 590
             $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath;
591 591
         }
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
     protected function getFieldByColumn($column)
950 950
     {
951 951
         return $this->builder->fields()->first(
952
-            function (Field $field) use ($column) {
952
+            function(Field $field) use ($column) {
953 953
                 if (is_array($field->column())) {
954 954
                     return in_array($column, $field->column());
955 955
                 }
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 
971 971
         $values = $this->model->toArray();
972 972
 
973
-        $this->builder->fields()->each(function (Field $field) use ($values) {
973
+        $this->builder->fields()->each(function(Field $field) use ($values) {
974 974
             $field->setOriginal($values);
975 975
         });
976 976
     }
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 
993 993
         $data = $this->model->toArray();
994 994
 
995
-        $this->builder->fields()->each(function (Field $field) use ($data) {
995
+        $this->builder->fields()->each(function(Field $field) use ($data) {
996 996
             if (!in_array($field->column(), $this->ignored)) {
997 997
                 $field->fill($data);
998 998
             }
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
      */
1114 1114
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
1115 1115
     {
1116
-        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) {
1116
+        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) {
1117 1117
             /* @var Field $field  */
1118 1118
             $field->setWidth($fieldWidth, $labelWidth);
1119 1119
         });
Please login to merge, or discard this patch.
src/Grid/Filter.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     {
208 208
         $inputs = array_dot(Input::all());
209 209
 
210
-        $inputs = array_filter($inputs, function ($input) {
210
+        $inputs = array_filter($inputs, function($input) {
211 211
             return $input !== '' && !is_null($input);
212 212
         });
213 213
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             $conditions[] = $filter->condition($params);
232 232
         }
233 233
 
234
-        return tap(array_filter($conditions), function ($conditions) {
234
+        return tap(array_filter($conditions), function($conditions) {
235 235
             if (!empty($conditions)) {
236 236
                 $this->expand();
237 237
             }
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
             return $inputs;
250 250
         }
251 251
 
252
-        $inputs = collect($inputs)->filter(function ($input, $key) {
252
+        $inputs = collect($inputs)->filter(function($input, $key) {
253 253
             return starts_with($key, "{$this->name}_");
254
-        })->mapWithKeys(function ($val, $key) {
254
+        })->mapWithKeys(function($val, $key) {
255 255
             $key = str_replace("{$this->name}_", '', $key);
256 256
 
257 257
             return [$key => $val];
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
      */
302 302
     public function scope($key, $label = '')
303 303
     {
304
-        return tap(new Scope($key, $label), function (Scope $scope) {
304
+        return tap(new Scope($key, $label), function(Scope $scope) {
305 305
             return $this->scopes->push($scope);
306 306
         });
307 307
     }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     {
326 326
         $key = request(Scope::QUERY_NAME);
327 327
 
328
-        return $this->scopes->first(function ($scope) use ($key) {
328
+        return $this->scopes->first(function($scope) use ($key) {
329 329
             return $scope->key == $key;
330 330
         });
331 331
     }
Please login to merge, or discard this patch.
src/Show/Field.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     public function using(array $values, $default = null)
174 174
     {
175
-        return $this->as(function ($value) use ($values, $default) {
175
+        return $this->as(function($value) use ($values, $default) {
176 176
             if (is_null($value)) {
177 177
                 return $default;
178 178
             }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function image($server = '', $width = 200, $height = 200)
194 194
     {
195
-        return $this->as(function ($path) use ($server, $width, $height) {
195
+        return $this->as(function($path) use ($server, $width, $height) {
196 196
             if (url()->isValidUrl($path)) {
197 197
                 $src = $path;
198 198
             } elseif ($server) {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         $field = $this;
218 218
 
219
-        return $this->as(function ($path) use ($server, $download, $field) {
219
+        return $this->as(function($path) use ($server, $download, $field) {
220 220
 
221 221
             $name = basename($path);
222 222
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 $storage = Storage::disk(config('admin.upload.disk'));
233 233
                 if ($storage->exists($path)) {
234 234
                     $url = $storage->url($path);
235
-                    $size = ($storage->size($path)/1000) . 'KB';
235
+                    $size = ($storage->size($path) / 1000).'KB';
236 236
                 }
237 237
             }
238 238
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      */
267 267
     public function link($href = '', $target = '_blank')
268 268
     {
269
-        return $this->as(function ($link) use ($href, $target) {
269
+        return $this->as(function($link) use ($href, $target) {
270 270
             $href = $href ?: $link;
271 271
 
272 272
             return "<a href='$href' target='{$target}'>{$link}</a>";
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
      */
283 283
     public function label($style = 'success')
284 284
     {
285
-        return $this->as(function ($value) use ($style) {
285
+        return $this->as(function($value) use ($style) {
286 286
             if ($value instanceof Arrayable) {
287 287
                 $value = $value->toArray();
288 288
             }
289 289
 
290
-            return collect((array) $value)->map(function ($name) use ($style) {
290
+            return collect((array) $value)->map(function($name) use ($style) {
291 291
                 return "<span class='label label-{$style}'>$name</span>";
292 292
             })->implode('&nbsp;');
293 293
         });
@@ -302,12 +302,12 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function badge($style = 'blue')
304 304
     {
305
-        return $this->as(function ($value) use ($style) {
305
+        return $this->as(function($value) use ($style) {
306 306
             if ($value instanceof Arrayable) {
307 307
                 $value = $value->toArray();
308 308
             }
309 309
 
310
-            return collect((array) $value)->map(function ($name) use ($style) {
310
+            return collect((array) $value)->map(function($name) use ($style) {
311 311
                 return "<span class='badge bg-{$style}'>$name</span>";
312 312
             })->implode('&nbsp;');
313 313
         });
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     {
323 323
         $field = $this;
324 324
 
325
-        return $this->as(function ($value) use ($field) {
325
+        return $this->as(function($value) use ($field) {
326 326
 
327 327
             $content = json_decode($value, true);
328 328
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
     public function render()
435 435
     {
436 436
         if ($this->showAs->isNotEmpty()) {
437
-            $this->showAs->each(function ($callable) {
437
+            $this->showAs->each(function($callable) {
438 438
                 $this->value = $callable->call(
439 439
                     $this->parent->getModel(),
440 440
                     $this->value
Please login to merge, or discard this patch.