Completed
Pull Request — master (#1350)
by
unknown
02:50
created
src/Grid.php 1 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,13 +286,13 @@  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.' . strtolower($relationColumn);
291
+        $trans_key = 'validation.attributes.'.strtolower($relationColumn);
292 292
 
293 293
          if (empty($label) && Lang::has($trans_key)) {
294 294
             $label = Lang::get($trans_key);
295
-        }else if (empty($label)) {
295
+        } else if (empty($label)) {
296 296
              $label = ucfirst($relationColumn);
297 297
          }
298 298
         return $label;
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         $callback = $this->actionsCallback;
452 452
         $column = $this->addColumn('__actions__', trans('admin.action'));
453 453
 
454
-        $column->display(function ($value) use ($grid, $column, $callback) {
454
+        $column->display(function($value) use ($grid, $column, $callback) {
455 455
             $actions = new Actions($value, $grid, $column, $this);
456 456
 
457 457
             return $actions->display($callback);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
      */
466 466
     public function disableRowSelector()
467 467
     {
468
-        $this->tools(function ($tools) {
468
+        $this->tools(function($tools) {
469 469
             /* @var Grid\Tools $tools */
470 470
             $tools->disableBatchActions();
471 471
         });
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         $column = new Column(Column::SELECT_COLUMN_NAME, ' ');
490 490
         $column->setGrid($this);
491 491
 
492
-        $column->display(function ($value) use ($grid, $column) {
492
+        $column->display(function($value) use ($grid, $column) {
493 493
             $actions = new RowSelector($value, $grid, $column, $this);
494 494
 
495 495
             return $actions->display();
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 
517 517
         Column::setOriginalGridData($data);
518 518
 
519
-        $this->columns->map(function (Column $column) use (&$data) {
519
+        $this->columns->map(function(Column $column) use (&$data) {
520 520
             $data = $column->fill($data);
521 521
 
522 522
             $this->columnNames[] = $column->getName();
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
      */
595 595
     protected function buildRows(array $data)
596 596
     {
597
-        $this->rows = collect($data)->map(function ($model, $number) {
597
+        $this->rows = collect($data)->map(function($model, $number) {
598 598
             return new Row($number, $model);
599 599
         });
600 600
 
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
     {
882 882
 //        $label = isset($arguments[0]) ? $arguments[0] : ucfirst($method);
883 883
         $label = isset($arguments[0]) ? $arguments[0] : null;
884
-        $label = $this->setLabel($label,$method);
884
+        $label = $this->setLabel($label, $method);
885 885
 
886 886
         if ($this->model()->eloquent() instanceof MongodbModel) {
887 887
             return $this->addColumn($method, $label);
Please login to merge, or discard this patch.
src/Form/Field/Tags.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             $this->value = explode(',', $this->value);
27 27
         }
28 28
 
29
-        $this->value = array_filter((array)$this->value);
29
+        $this->value = array_filter((array) $this->value);
30 30
     }
31 31
 
32 32
     /**
Please login to merge, or discard this patch.
src/Form/Field/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         if (is_callable($options)) {
71 71
             $this->options = $options;
72 72
         } else {
73
-            $this->options = (array)$options;
73
+            $this->options = (array) $options;
74 74
         }
75 75
 
76 76
         return $this;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     protected function loadOptionsFromRemote($url, $parameters = [], $options = [])
146 146
     {
147 147
         $ajaxOptions = [
148
-            'url' => $url . '?' . http_build_query($parameters),
148
+            'url' => $url.'?'.http_build_query($parameters),
149 149
         ];
150 150
 
151 151
         $ajaxOptions = json_encode(array_merge($ajaxOptions, $options));
Please login to merge, or discard this patch.
src/Form/Builder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function field($name)
261 261
     {
262
-        return $this->fields()->first(function (Field $field) use ($name) {
262
+        return $this->fields()->first(function(Field $field) use ($name) {
263 263
             return $field->column() == $name;
264 264
         });
265 265
     }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
             $this->form->model()->getUpdatedAtColumn(),
503 503
         ];
504 504
 
505
-        $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) {
505
+        $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) {
506 506
             return in_array($field->column(), $reservedColumns);
507 507
         });
508 508
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     {
529 529
         $rules = [];
530 530
         foreach ($this->fields() as $item) {
531
-            if(!empty($item->getRules())){
531
+            if (!empty($item->getRules())) {
532 532
                 $rules[$item->id] = $item->getRules();
533 533
             }
534 534
         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     public function getRuleMessages()
545 545
     {
546 546
         $rules = [];
547
-        foreach ($this->fields() as $item ) {
547
+        foreach ($this->fields() as $item) {
548 548
             foreach ($item->validationMessages as $key => $value) {
549 549
                 $rules[$key] = $value;
550 550
             }
Please login to merge, or discard this patch.
src/Form/Field.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     {
245 245
         $column = is_array($this->column) ? current($this->column) : $this->column;
246 246
 
247
-        $trans_key = 'validation.attributes.' . strtolower($column);
247
+        $trans_key = 'validation.attributes.'.strtolower($column);
248 248
         if (isset($arguments[0])) {
249 249
             $label = $arguments[0];
250 250
         } else if (Lang::has($trans_key)) {
@@ -619,9 +619,9 @@  discard block
 block discarded – undo
619 619
                 if (!array_key_exists($column, $input)) {
620 620
                     continue;
621 621
                 }
622
-                $input[$column . $key] = array_get($input, $column);
623
-                $rules[$column . $key] = $fieldRules;
624
-                $attributes[$column . $key] = $this->label . "[$column]";
622
+                $input[$column.$key] = array_get($input, $column);
623
+                $rules[$column.$key] = $fieldRules;
624
+                $attributes[$column.$key] = $this->label."[$column]";
625 625
             }
626 626
         }
627 627
 
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
         if (is_array($attribute)) {
660 660
             $this->attributes = array_merge($this->attributes, $attribute);
661 661
         } else {
662
-            $this->attributes[$attribute] = (string)$value;
662
+            $this->attributes[$attribute] = (string) $value;
663 663
         }
664 664
 
665 665
         return $this;
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
      */
697 697
     public function getPlaceholder()
698 698
     {
699
-        return $this->placeholder ?: trans('admin.input') . ' ' . $this->label;
699
+        return $this->placeholder ?: trans('admin.input').' '.$this->label;
700 700
     }
701 701
 
702 702
     /**
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
         $html = [];
722 722
 
723 723
         foreach ($this->attributes as $name => $value) {
724
-            $html[] = $name . '="' . e($value) . '"';
724
+            $html[] = $name.'="'.e($value).'"';
725 725
         }
726 726
 
727 727
         return implode(' ', $html);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
      */
767 767
     public function setElementClass($class)
768 768
     {
769
-        $this->elementClass = (array)$class;
769
+        $this->elementClass = (array) $class;
770 770
 
771 771
         return $this;
772 772
     }
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
         if (!$this->elementClass) {
782 782
             $name = $this->elementName ?: $this->formatName($this->column);
783 783
 
784
-            $this->elementClass = (array)str_replace([
784
+            $this->elementClass = (array) str_replace([
785 785
                 '[',
786 786
                 ']'
787 787
             ], '_', $name);
@@ -825,13 +825,13 @@  discard block
 block discarded – undo
825 825
             $classes = [];
826 826
 
827 827
             foreach ($elementClass as $index => $class) {
828
-                $classes[$index] = '.' . (is_array($class) ? implode('.', $class) : $class);
828
+                $classes[$index] = '.'.(is_array($class) ? implode('.', $class) : $class);
829 829
             }
830 830
 
831 831
             return $classes;
832 832
         }
833 833
 
834
-        return '.' . implode('.', $elementClass);
834
+        return '.'.implode('.', $elementClass);
835 835
     }
836 836
 
837 837
     /**
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
     public function addElementClass($class)
845 845
     {
846 846
         if (is_array($class) || is_string($class)) {
847
-            $this->elementClass = array_merge($this->elementClass, (array)$class);
847
+            $this->elementClass = array_merge($this->elementClass, (array) $class);
848 848
 
849 849
             $this->elementClass = array_unique($this->elementClass);
850 850
         }
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
         $delClass = [];
865 865
 
866 866
         if (is_string($class) || is_array($class)) {
867
-            $delClass = (array)$class;
867
+            $delClass = (array) $class;
868 868
         }
869 869
 
870 870
         foreach ($delClass as $del) {
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 
912 912
         $class = explode('\\', get_called_class());
913 913
 
914
-        return 'admin::form.' . strtolower(end($class));
914
+        return 'admin::form.'.strtolower(end($class));
915 915
     }
916 916
 
917 917
     /**
Please login to merge, or discard this patch.
src/Form/Tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     protected function collectFields(\Closure $content)
65 65
     {
66 66
         call_user_func($content, $this->form);
67
-        $all =  $this->form->builder()->removeReservedFields()->fields();
67
+        $all = $this->form->builder()->removeReservedFields()->fields();
68 68
 
69 69
         $fields = $all->slice($this->offset);
70 70
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function getTabs()
82 82
     {
83 83
         // If there is no active tab, then active the first.
84
-        if ($this->tabs->filter(function ($tab) {
84
+        if ($this->tabs->filter(function($tab) {
85 85
             return $tab['active'];
86 86
         })->isEmpty()) {
87 87
             $first = $this->tabs->first();
Please login to merge, or discard this patch.