Completed
Push — master ( 8c64c3...017009 )
by Song
02:56
created
src/Show/Field.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function using(array $values, $default = null)
193 193
     {
194
-        return $this->as(function ($value) use ($values, $default) {
194
+        return $this->as(function($value) use ($values, $default) {
195 195
             if (is_null($value)) {
196 196
                 return $default;
197 197
             }
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
      */
212 212
     public function image($server = '', $width = 200, $height = 200)
213 213
     {
214
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
215
-            return collect($images)->map(function ($path) use ($server, $width, $height) {
214
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
215
+            return collect($images)->map(function($path) use ($server, $width, $height) {
216 216
                 if (empty($path)) {
217 217
                     return '';
218 218
                 }
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
      */
248 248
     public function carousel($width = 300, $height = 200, $server = '')
249 249
     {
250
-        return $this->unescape()->as(function ($images) use ($server, $width, $height) {
251
-            $items = collect($images)->map(function ($path) use ($server, $width, $height) {
250
+        return $this->unescape()->as(function($images) use ($server, $width, $height) {
251
+            $items = collect($images)->map(function($path) use ($server, $width, $height) {
252 252
                 if (empty($path)) {
253 253
                     return '';
254 254
                 }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     {
289 289
         $field = $this;
290 290
 
291
-        return $this->unescape()->as(function ($path) use ($server, $download, $field) {
291
+        return $this->unescape()->as(function($path) use ($server, $download, $field) {
292 292
             $name = basename($path);
293 293
 
294 294
             $field->border = false;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function link($href = '', $target = '_blank')
342 342
     {
343
-        return $this->unescape()->as(function ($link) use ($href, $target) {
343
+        return $this->unescape()->as(function($link) use ($href, $target) {
344 344
             $href = $href ?: $link;
345 345
 
346 346
             return "<a href='$href' target='{$target}'>{$link}</a>";
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
      */
357 357
     public function label($style = 'success')
358 358
     {
359
-        return $this->unescape()->as(function ($value) use ($style) {
359
+        return $this->unescape()->as(function($value) use ($style) {
360 360
             if ($value instanceof Arrayable) {
361 361
                 $value = $value->toArray();
362 362
             }
363 363
 
364
-            return collect((array) $value)->map(function ($name) use ($style) {
364
+            return collect((array) $value)->map(function($name) use ($style) {
365 365
                 return "<span class='label label-{$style}'>$name</span>";
366 366
             })->implode('&nbsp;');
367 367
         });
@@ -376,12 +376,12 @@  discard block
 block discarded – undo
376 376
      */
377 377
     public function badge($style = 'blue')
378 378
     {
379
-        return $this->unescape()->as(function ($value) use ($style) {
379
+        return $this->unescape()->as(function($value) use ($style) {
380 380
             if ($value instanceof Arrayable) {
381 381
                 $value = $value->toArray();
382 382
             }
383 383
 
384
-            return collect((array) $value)->map(function ($name) use ($style) {
384
+            return collect((array) $value)->map(function($name) use ($style) {
385 385
                 return "<span class='badge bg-{$style}'>$name</span>";
386 386
             })->implode('&nbsp;');
387 387
         });
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     {
397 397
         $field = $this;
398 398
 
399
-        return $this->unescape()->as(function ($value) use ($field) {
399
+        return $this->unescape()->as(function($value) use ($field) {
400 400
             $content = json_decode($value, true);
401 401
 
402 402
             if (json_last_error() == 0) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      */
417 417
     public function filesize()
418 418
     {
419
-        return $this->as(function ($value) {
419
+        return $this->as(function($value) {
420 420
             return file_size($value);
421 421
         });
422 422
     }
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
         $field = $this;
557 557
 
558
-        return $this->as(function ($value) use ($extend, $field, $arguments) {
558
+        return $this->as(function($value) use ($extend, $field, $arguments) {
559 559
             if (!$extend->border) {
560 560
                 $field->border = false;
561 561
             }
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
     public function render()
615 615
     {
616 616
         if ($this->showAs->isNotEmpty()) {
617
-            $this->showAs->each(function ($callable) {
617
+            $this->showAs->each(function($callable) {
618 618
                 $this->value = $callable->call(
619 619
                     $this->parent->getModel(),
620 620
                     $this->value
Please login to merge, or discard this patch.
src/Grid.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $column = new Column($column, $label);
359 359
         $column->setGrid($this);
360 360
 
361
-        return tap($column, function ($value) {
361
+        return tap($column, function($value) {
362 362
             $this->columns->push($value);
363 363
         });
364 364
     }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $column = new Column($column, $label);
423 423
         $column->setGrid($this);
424 424
 
425
-        return tap($column, function ($value) {
425
+        return tap($column, function($value) {
426 426
             $this->columns->prepend($value);
427 427
         });
428 428
     }
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
         $data = $collection->toArray();
589 589
 
590
-        $this->columns->map(function (Column $column) use (&$data) {
590
+        $this->columns->map(function(Column $column) use (&$data) {
591 591
             $data = $column->fill($data);
592 592
 
593 593
             $this->columnNames[] = $column->getName();
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
      */
608 608
     protected function buildRows(array $data)
609 609
     {
610
-        $this->rows = collect($data)->map(function ($model, $number) {
610
+        $this->rows = collect($data)->map(function($model, $number) {
611 611
             return new Row($number, $model);
612 612
         });
613 613
 
Please login to merge, or discard this patch.
src/Grid/Concerns/HasQuickSearch.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,14 +125,14 @@
 block discarded – undo
125 125
      */
126 126
     protected function parseQueryBindings(array $queries)
127 127
     {
128
-        $columnMap = $this->columns->mapWithKeys(function (Column $column) {
128
+        $columnMap = $this->columns->mapWithKeys(function(Column $column) {
129 129
             $label = $column->getLabel();
130 130
             $name = $column->getName();
131 131
 
132 132
             return [$label => $name, $name => $name];
133 133
         });
134 134
 
135
-        return collect($queries)->map(function ($query) use ($columnMap) {
135
+        return collect($queries)->map(function($query) use ($columnMap) {
136 136
             $segments = explode(':', $query, 2);
137 137
 
138 138
             if (count($segments) != 2) {
Please login to merge, or discard this patch.
src/Widgets/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      */
301 301
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
302 302
     {
303
-        collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) {
303
+        collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) {
304 304
             /* @var Field $field  */
305 305
             $field->setWidth($fieldWidth, $labelWidth);
306 306
         });
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 
518 518
         $field = new $class(Arr::get($arguments, 0), array_slice($arguments, 1));
519 519
 
520
-        return tap($field, function ($field) {
520
+        return tap($field, function($field) {
521 521
             $this->pushField($field);
522 522
         });
523 523
     }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -289,7 +289,7 @@
 block discarded – undo
289 289
                 $value     = $subArray['options'];
290 290
                 $original  = array_merge($original, $subArray['original']);
291 291
                 $toReplace = array_merge($toReplace, $subArray['toReplace']);
292
-            } elseif(strpos($value, 'function(') === 0){
292
+            } elseif (strpos($value, 'function(') === 0) {
293 293
                 $original[]  = $value;
294 294
                 $value       = "%{$key}%";
295 295
                 $toReplace[] = "\"{$value}\"";
Please login to merge, or discard this patch.
src/Grid/Displayers/Download.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             $this->value = $this->value->toArray();
14 14
         }
15 15
 
16
-        return collect((array) $this->value)->filter()->map(function ($value) use ($server) {
16
+        return collect((array) $this->value)->filter()->map(function($value) use ($server) {
17 17
 
18 18
             if (empty($value)) {
19 19
                 return '';
Please login to merge, or discard this patch.
src/Grid/Column.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
         $column = $this;
411 411
 
412
-        return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) {
412
+        return $this->display(function($value) use ($grid, $column, $abstract, $arguments) {
413 413
             /** @var AbstractDisplayer $displayer */
414 414
             $displayer = new $abstract($value, $grid, $column, $this);
415 415
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     public function using(array $values, $default = null)
429 429
     {
430
-        return $this->display(function ($value) use ($values, $default) {
430
+        return $this->display(function($value) use ($values, $default) {
431 431
             if (is_null($value)) {
432 432
                 return $default;
433 433
             }
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
      */
446 446
     public function view($view)
447 447
     {
448
-        return $this->display(function ($value) use ($view) {
448
+        return $this->display(function($value) use ($view) {
449 449
             $model = $this;
450 450
 
451 451
             return view($view, compact('model', 'value'))->render();
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
      */
486 486
     public function filesize()
487 487
     {
488
-        return $this->display(function ($value) {
488
+        return $this->display(function($value) {
489 489
             return file_size($value);
490 490
         });
491 491
     }
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
      */
500 500
     public function gravatar($size = 30)
501 501
     {
502
-        return $this->display(function ($value) use ($size) {
502
+        return $this->display(function($value) use ($size) {
503 503
             $src = sprintf(
504 504
                 'https://www.gravatar.com/avatar/%s?s=%d',
505 505
                 md5(strtolower($value)),
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
      */
521 521
     public function loading($values = [], $others = [])
522 522
     {
523
-        return $this->display(function ($value) use ($values, $others) {
523
+        return $this->display(function($value) use ($values, $others) {
524 524
 
525 525
             $values = (array) $values;
526 526
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
      */
543 543
     public function icon(array $setting, $default = '')
544 544
     {
545
-        return $this->display(function ($value) use ($setting, $default) {
545
+        return $this->display(function($value) use ($setting, $default) {
546 546
 
547 547
             $fa = '';
548 548
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
             Carbon::setLocale($locale);
570 570
         }
571 571
 
572
-        return $this->display(function ($value) {
572
+        return $this->display(function($value) {
573 573
             return Carbon::parse($value)->diffForHumans();
574 574
         });
575 575
     }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         $grid = $this->grid;
691 691
         $column = $this;
692 692
 
693
-        $this->display(function ($value) use ($grid, $column, $class) {
693
+        $this->display(function($value) use ($grid, $column, $class) {
694 694
             /** @var AbstractDisplayer $definition */
695 695
             $definition = new $class($value, $grid, $column, $this);
696 696
 
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
     protected function htmlEntityEncode($item)
709 709
     {
710 710
         if (is_array($item)) {
711
-            array_walk_recursive($item, function (&$value) {
711
+            array_walk_recursive($item, function(&$value) {
712 712
                 $value = htmlentities($value);
713 713
             });
714 714
         } else {
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
             'content'   => $this->help,
797 797
         ];
798 798
 
799
-        $data = collect($data)->map(function ($val, $key) {
799
+        $data = collect($data)->map(function($val, $key) {
800 800
             return "data-{$key}=\"{$val}\"";
801 801
         })->implode(' ');
802 802
 
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
      */
835 835
     protected function callSupportDisplayer($abstract, $arguments)
836 836
     {
837
-        return $this->display(function ($value) use ($abstract, $arguments) {
837
+        return $this->display(function($value) use ($abstract, $arguments) {
838 838
             if (is_array($value) || $value instanceof Arrayable) {
839 839
                 return call_user_func_array([collect($value), $abstract], $arguments);
840 840
             }
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
     protected function callBuiltinDisplayer($abstract, $arguments)
859 859
     {
860 860
         if ($abstract instanceof Closure) {
861
-            return $this->display(function ($value) use ($abstract, $arguments) {
861
+            return $this->display(function($value) use ($abstract, $arguments) {
862 862
                 return $abstract->call($this, ...array_merge([$value], $arguments));
863 863
             });
864 864
         }
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
             $grid = $this->grid;
868 868
             $column = $this;
869 869
 
870
-            return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) {
870
+            return $this->display(function($value) use ($abstract, $grid, $column, $arguments) {
871 871
                 /** @var AbstractDisplayer $displayer */
872 872
                 $displayer = new $abstract($value, $grid, $column, $this);
873 873
 
Please login to merge, or discard this patch.
src/Form/Field/ImageField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
             $image = InterventionImage::make($file);
170 170
 
171 171
             // Resize image with aspect ratio
172
-            $image->resize($size[0], $size[1], function (Constraint $constraint) {
172
+            $image->resize($size[0], $size[1], function(Constraint $constraint) {
173 173
                 $constraint->aspectRatio();
174 174
             })->resizeCanvas($size[0], $size[1], 'center', false, '#ffffff');
175 175
 
Please login to merge, or discard this patch.