Completed
Pull Request — master (#4709)
by
unknown
02:27
created
src/Controllers/MenuController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
         return $content
27 27
             ->title(trans('admin.menu'))
28 28
             ->description(trans('admin.list'))
29
-            ->row(function (Row $row) {
29
+            ->row(function(Row $row) {
30 30
                 $row->column(6, $this->treeView()->render());
31 31
 
32
-                $row->column(6, function (Column $column) {
32
+                $row->column(6, function(Column $column) {
33 33
                     $form = new \Encore\Admin\Widgets\Form();
34 34
                     $form->action(admin_url('auth/menu'));
35 35
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         $tree->disableCreate();
77 77
 
78
-        $tree->branch(function ($branch) {
78
+        $tree->branch(function($branch) {
79 79
             $payload = "<i class='fa {$branch['icon']}'></i>&nbsp;<strong>{$branch['title']}</strong>";
80 80
 
81 81
             if (!isset($branch['children'])) {
Please login to merge, or discard this patch.
src/Console/GenerateMenuCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function handle()
50 50
     {
51
-        $routes = collect($this->router->getRoutes())->filter(function (Route $route) {
51
+        $routes = collect($this->router->getRoutes())->filter(function(Route $route) {
52 52
             $uri = $route->uri();
53 53
             // built-in, parameterized and no-GET are ignored
54 54
             return Str::startsWith($uri, 'admin/')
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 && !Str::contains($uri, '{')
58 58
                 && in_array('GET', $route->methods());
59 59
         })
60
-            ->map(function (Route $route) {
60
+            ->map(function(Route $route) {
61 61
                 $uri = substr($route->uri(), strlen('admin/'));
62 62
 
63 63
                 return [
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $menus = Menu::all()->pluck('title', 'uri');
73 73
         // exclude exist ones
74
-        $news = $routes->diffKeys($menus)->map(function ($item, $key) {
74
+        $news = $routes->diffKeys($menus)->map(function($item, $key) {
75 75
             return [
76 76
                 'title' => $item,
77 77
                 'uri'   => $key,
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         } else {
86 86
             if ($this->hasOption('dry-run') && $this->option('dry-run')) {
87 87
                 $this->line('<info>The following menu items will be created</info>: ');
88
-                $this->table(['Title', 'Uri'], array_map(function ($item) {
88
+                $this->table(['Title', 'Uri'], array_map(function($item) {
89 89
                     return [
90 90
                         $item['title'],
91 91
                         $item['uri'],
Please login to merge, or discard this patch.
src/Form/Field/MultipleFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         // for create or update
156 156
         if ($this->pathColumn) {
157
-            $targets = array_map(function ($target) {
157
+            $targets = array_map(function($target) {
158 158
                 return [$this->pathColumn => $target];
159 159
             }, $targets);
160 160
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         $this->name = $this->getStoreName($file);
187 187
 
188
-        return tap($this->upload($file), function () {
188
+        return tap($this->upload($file), function() {
189 189
             $this->name = null;
190 190
         });
191 191
     }
Please login to merge, or discard this patch.
src/Grid/Actions/Delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         ];
30 30
 
31 31
         try {
32
-            DB::transaction(function () use ($model) {
32
+            DB::transaction(function() use ($model) {
33 33
                 $model->delete();
34 34
             });
35 35
         } catch (\Exception $exception) {
Please login to merge, or discard this patch.
src/Grid/Exporters/CsvExporter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
             call_user_func($this->callback, $this);
140 140
         }
141 141
 
142
-        $response = function () {
142
+        $response = function() {
143 143
             $handle = fopen('php://output', 'w');
144 144
             $titles = [];
145 145
 
146
-            $this->chunk(function ($collection) use ($handle, &$titles) {
146
+            $this->chunk(function($collection) use ($handle, &$titles) {
147 147
                 Column::setOriginalGridModels($collection);
148 148
 
149 149
                 $original = $current = $collection->toArray();
150 150
 
151
-                $this->grid->getColumns()->map(function (Column $column) use (&$current) {
151
+                $this->grid->getColumns()->map(function(Column $column) use (&$current) {
152 152
                     $current = $column->fill($current);
153 153
                     $this->grid->columnNames[] = $column->getName();
154 154
                 });
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     protected function getVisiableTitles()
178 178
     {
179 179
         $titles = $this->grid->visibleColumns()
180
-            ->mapWithKeys(function (Column $column) {
180
+            ->mapWithKeys(function(Column $column) {
181 181
                 return [$column->getName() => $column->getLabel()];
182 182
             });
183 183
 
Please login to merge, or discard this patch.
src/Grid/Selectable.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $this->disablePagination();
87 87
         }
88 88
 
89
-        $this->tools(function (Tools $tools) {
89
+        $this->tools(function(Tools $tools) {
90 90
             $tools->append(new Grid\Selectable\BrowserBtn());
91 91
         });
92 92
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $hide = $hide ? 'hide' : '';
99 99
         $key = $this->key;
100 100
 
101
-        $this->column('__remove__', ' ')->display(function () use ($hide, $key) {
101
+        $this->column('__remove__', ' ')->display(function() use ($hide, $key) {
102 102
             return <<<BTN
103 103
 <a href="javascript:void(0);" class="grid-row-remove {$hide}" data-key="{$this->getAttribute($key)}">
104 104
     <i class="fa fa-trash"></i>
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,6 @@
 block discarded – undo
67 67
     }
68 68
 
69 69
     /**
70
-     * @param bool $multiple
71 70
      *
72 71
      * @return string
73 72
      */
Please login to merge, or discard this patch.
src/Grid/Displayers/AbstractDisplayer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     }
80 80
 
81 81
     /**
82
-     * @param mixed $key
82
+     * @param string $key
83 83
      *
84 84
      * @return mixed
85 85
      */
Please login to merge, or discard this patch.
src/Console/ConfigCommand.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -57,6 +57,10 @@
 block discarded – undo
57 57
             });
58 58
     }
59 59
 
60
+    /**
61
+     * @param string $title
62
+     * @param \Illuminate\Support\Collection $diff
63
+     */
60 64
     protected function printDiff($title, $diff, $error = false)
61 65
     {
62 66
         if ($diff->isEmpty()) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         return collect(Arr::dot($from))
54 54
             ->keys()
55
-            ->reject(function ($key) use ($to) {
55
+            ->reject(function($key) use ($to) {
56 56
                 return Arr::has($to, $key);
57 57
             });
58 58
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $this->line('');
67 67
         $this->comment("{$title}:");
68 68
 
69
-        $diff->each(function ($key) use ($error) {
69
+        $diff->each(function($key) use ($error) {
70 70
             if ($error) {
71 71
                 $this->error("    {$key}");
72 72
             } else {
Please login to merge, or discard this patch.
src/Form/Field/CanCascadeFields.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
      */
103 103
     protected function applyCascadeConditions()
104 104
     {
105
-        if( $this->form ) {
105
+        if ($this->form) {
106 106
             $this->form->fields()
107
-                ->filter(function (Form\Field $field) {
107
+                ->filter(function(Form\Field $field) {
108 108
                     return $field instanceof CascadeGroup
109 109
                         && $field->dependsOn($this)
110 110
                         && $this->hitsCondition($field);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             return;
163 163
         }
164 164
 
165
-        $cascadeGroups = collect($this->conditions)->map(function ($condition) {
165
+        $cascadeGroups = collect($this->conditions)->map(function($condition) {
166 166
             return [
167 167
                 'class'    => $this->getCascadeClass($condition['value']),
168 168
                 'operator' => $condition['operator'],
Please login to merge, or discard this patch.