Completed
Pull Request — master (#4699)
by
unknown
02:48
created
src/Show/Field.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function using(array $values, $default = null)
194 194
     {
195
-        return $this->as(function ($value) use ($values, $default) {
195
+        return $this->as(function($value) use ($values, $default) {
196 196
             if (is_null($value)) {
197 197
                 return $default;
198 198
             }
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function image($server = '', $width = 200, $height = 200)
214 214
     {
215
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
216
-            return collect($images)->map(function ($path) use ($server, $width, $height) {
215
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
216
+            return collect($images)->map(function($path) use ($server, $width, $height) {
217 217
                 if (empty($path)) {
218 218
                     return '';
219 219
                 }
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public function multiImage($server = '', $width = 200, $height = 200)
250 250
     {
251
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
252
-            return collect($images)->map(function ($path) use ($server, $width, $height) {
251
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
252
+            return collect($images)->map(function($path) use ($server, $width, $height) {
253 253
                 if (empty($path)) {
254 254
                     return '';
255 255
                 }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                     if (url()->isValidUrl($value)) {
261 261
                         $src = $value;
262 262
                     } elseif ($server) {
263
-                        $src = $server . $value;
263
+                        $src = $server.$value;
264 264
                     } else {
265 265
                         $disk = config('admin.upload.disk');
266 266
 
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
      */
289 289
     public function carousel($width = 300, $height = 200, $server = '')
290 290
     {
291
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
292
-            $items = collect($images)->map(function ($path) use ($server, $width, $height) {
291
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
292
+            $items = collect($images)->map(function($path) use ($server, $width, $height) {
293 293
                 if (empty($path)) {
294 294
                     return '';
295 295
                 }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     {
330 330
         $field = $this;
331 331
 
332
-        return $this->unescape()->as(function ($path) use ($server, $download, $field) {
332
+        return $this->unescape()->as(function($path) use ($server, $download, $field) {
333 333
             $name = basename($path);
334 334
 
335 335
             $field->border = false;
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     public function link($href = '', $target = '_blank')
385 385
     {
386
-        return $this->unescape()->as(function ($link) use ($href, $target) {
386
+        return $this->unescape()->as(function($link) use ($href, $target) {
387 387
             $href = $href ?: $link;
388 388
 
389 389
             return "<a href='$href' target='{$target}'>{$link}</a>";
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
      */
400 400
     public function label($style = 'success')
401 401
     {
402
-        return $this->unescape()->as(function ($value) use ($style) {
402
+        return $this->unescape()->as(function($value) use ($style) {
403 403
             if ($value instanceof Arrayable) {
404 404
                 $value = $value->toArray();
405 405
             }
406 406
 
407
-            return collect((array) $value)->map(function ($name) use ($style) {
407
+            return collect((array) $value)->map(function($name) use ($style) {
408 408
                 return "<span class='label label-{$style}'>$name</span>";
409 409
             })->implode('&nbsp;');
410 410
         });
@@ -419,12 +419,12 @@  discard block
 block discarded – undo
419 419
      */
420 420
     public function badge($style = 'blue')
421 421
     {
422
-        return $this->unescape()->as(function ($value) use ($style) {
422
+        return $this->unescape()->as(function($value) use ($style) {
423 423
             if ($value instanceof Arrayable) {
424 424
                 $value = $value->toArray();
425 425
             }
426 426
 
427
-            return collect((array) $value)->map(function ($name) use ($style) {
427
+            return collect((array) $value)->map(function($name) use ($style) {
428 428
                 return "<span class='badge bg-{$style}'>$name</span>";
429 429
             })->implode('&nbsp;');
430 430
         });
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     {
440 440
         $field = $this;
441 441
 
442
-        return $this->unescape()->as(function ($value) use ($field) {
442
+        return $this->unescape()->as(function($value) use ($field) {
443 443
             $content = json_decode($value, true);
444 444
 
445 445
             if (json_last_error() == 0) {
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
      */
460 460
     public function filesize()
461 461
     {
462
-        return $this->as(function ($value) {
462
+        return $this->as(function($value) {
463 463
             return file_size($value);
464 464
         });
465 465
     }
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 
618 618
         $field = $this;
619 619
 
620
-        return $this->as(function ($value) use ($extend, $field, $arguments) {
620
+        return $this->as(function($value) use ($extend, $field, $arguments) {
621 621
             if (!$extend->border) {
622 622
                 $field->border = false;
623 623
             }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
     public function render()
677 677
     {
678 678
         if ($this->showAs->isNotEmpty()) {
679
-            $this->showAs->each(function ($callable) {
679
+            $this->showAs->each(function($callable) {
680 680
                 $this->value = $callable->call(
681 681
                     $this->parent->getModel(),
682 682
                     $this->value
Please login to merge, or discard this patch.