Passed
Push — fix/818 ( 4e4f79...2f124a )
by Quentin
05:20
created
src/Repositories/Behaviors/HandleFieldsGroups.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,12 +85,12 @@
 block discarded – undo
85 85
     {
86 86
         foreach ($this->fieldsGroups as $group => $groupFields) {
87 87
             if ($this->fieldsGroupsFormFieldNamesAutoPrefix) {
88
-                $groupFields = array_map(function ($field_name) use ($group) {
88
+                $groupFields = array_map(function($field_name) use ($group) {
89 89
                     return $group . $this->fieldsGroupsFormFieldNameSeparator . $field_name;
90 90
                 }, $groupFields);
91 91
             }
92 92
 
93
-            $fields[$group] = Arr::where(Arr::only($fields, $groupFields), function ($value, $key) {
93
+            $fields[$group] = Arr::where(Arr::only($fields, $groupFields), function($value, $key) {
94 94
                 return !empty($value);
95 95
             });
96 96
 
Please login to merge, or discard this patch.
src/RouteServiceProvider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         $middlewares,
83 83
         $supportSubdomainRouting
84 84
     ) {
85
-        $internalRoutes = function ($router) use (
85
+        $internalRoutes = function($router) use (
86 86
             $middlewares,
87 87
             $supportSubdomainRouting
88 88
         ) {
89
-            $router->group(['middleware' => $middlewares], function ($router) {
89
+            $router->group(['middleware' => $middlewares], function($router) {
90 90
                 require __DIR__ . '/../routes/admin.php';
91 91
             });
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                     ? ['supportSubdomainRouting']
97 97
                     : [],
98 98
                 ],
99
-                function ($router) {
99
+                function($router) {
100 100
                     require __DIR__ . '/../routes/auth.php';
101 101
                 }
102 102
             );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                     ? ['twill_auth:twill_users']
108 108
                     : [],
109 109
                 ],
110
-                function ($router) {
110
+                function($router) {
111 111
                     require __DIR__ . '/../routes/templates.php';
112 112
                 }
113 113
             );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             $groupOptions + [
118 118
                 'namespace' => $this->namespace . '\Admin',
119 119
             ],
120
-            function ($router) use ($internalRoutes, $supportSubdomainRouting) {
120
+            function($router) use ($internalRoutes, $supportSubdomainRouting) {
121 121
                 $router->group(
122 122
                     [
123 123
                         'domain' => config('twill.admin_app_url'),
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                         config('twill.admin_middleware_group', 'web'),
149 149
                     ],
150 150
                 ],
151
-                function ($router) {
151
+                function($router) {
152 152
                     $router->group(
153 153
                         [
154 154
                             'middleware' => $this->app->environment(
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                             ? ['twill_auth:twill_users']
158 158
                             : [],
159 159
                         ],
160
-                        function ($router) {
160
+                        function($router) {
161 161
                             require __DIR__ . '/../routes/templates.php';
162 162
                         }
163 163
                     );
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     protected function registerMacros()
212 212
     {
213
-        Route::macro('moduleShowWithPreview', function (
213
+        Route::macro('moduleShowWithPreview', function(
214 214
             $moduleName,
215 215
             $routePrefix = null,
216 216
             $controllerName = null
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                 ->middleware(['web', 'twill_auth:twill_users', 'can:list']);
245 245
         });
246 246
 
247
-        Route::macro('module', function (
247
+        Route::macro('module', function(
248 248
             $slug,
249 249
             $options = [],
250 250
             $resource_options = [],
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             $_slug = Arr::last($slugs);
256 256
             $className = implode(
257 257
                 '',
258
-                array_map(function ($s) {
258
+                array_map(function($s) {
259 259
                     return ucfirst(Str::singular($s));
260 260
                 }, $slugs)
261 261
             );
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
             if ($resource) {
381 381
                 Route::group(
382 382
                     ['as' => $resourceCustomGroupPrefix],
383
-                    function () use ($slug, $className, $resource_options) {
383
+                    function() use ($slug, $className, $resource_options) {
384 384
                         Route::resource(
385 385
                             $slug,
386 386
                             "{$className}Controller",
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             }
392 392
         });
393 393
 
394
-        Route::macro('singleton', function (
394
+        Route::macro('singleton', function(
395 395
             $slug,
396 396
             $options = [],
397 397
             $resource_options = [],
Please login to merge, or discard this patch.
src/Helpers/routes_helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      * @param bool $absolute
13 13
      * @return string
14 14
      */
15
-    function moduleRoute($moduleName, $prefix, $action='', $parameters = [], $absolute = true)
15
+    function moduleRoute($moduleName, $prefix, $action = '', $parameters = [], $absolute = true)
16 16
     {
17 17
         // Fix module name case
18 18
         $moduleName = Str::camel($moduleName);
Please login to merge, or discard this patch.
src/Http/Controllers/Admin/ModuleController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             "$this->viewPrefix.index",
362 362
             "twill::$this->moduleName.index",
363 363
             "twill::layouts.listing",
364
-        ])->first(function ($view) {
364
+        ])->first(function($view) {
365 365
             return View::exists($view);
366 366
         });
367 367
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
             "$this->viewPrefix.form",
471 471
             "twill::$this->moduleName.form",
472 472
             "twill::layouts.form",
473
-        ])->first(function ($view) {
473
+        ])->first(function($view) {
474 474
             return View::exists($view);
475 475
         });
476 476
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
             "$this->viewPrefix.form",
502 502
             "twill::$this->moduleName.form",
503 503
             "twill::layouts.form",
504
-        ])->first(function ($view) {
504
+        ])->first(function($view) {
505 505
             return View::exists($view);
506 506
         });
507 507
 
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
             "$this->viewPrefix.form",
630 630
             "twill::$this->moduleName.form",
631 631
             "twill::layouts.form",
632
-        ])->first(function ($view) {
632
+        ])->first(function($view) {
633 633
             return View::exists($view);
634 634
         });
635 635
 
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
         $query = $this->request->input('q');
892 892
         $tags = $this->repository->getTags($query);
893 893
 
894
-        return Response::json(['items' => $tags->map(function ($tag) {
894
+        return Response::json(['items' => $tags->map(function($tag) {
895 895
             return $tag->name;
896 896
         })], 200);
897 897
     }
@@ -979,8 +979,8 @@  discard block
 block discarded – undo
979 979
     protected function getIndexTableData($items)
980 980
     {
981 981
         $translated = $this->moduleHas('translations');
982
-        return $items->map(function ($item) use ($translated) {
983
-            $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function ($column) use ($item) {
982
+        return $items->map(function($item) use ($translated) {
983
+            $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function($column) use ($item) {
984 984
                 return $this->getItemColumnData($item, $column);
985 985
             })->toArray();
986 986
 
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
             'feature',
1241 1241
             'bulkFeature',
1242 1242
             'bulkDelete',
1243
-        ])->mapWithKeys(function ($endpoint) {
1243
+        ])->mapWithKeys(function($endpoint) {
1244 1244
             return [
1245 1245
                 $endpoint . 'Url' => $this->getIndexOption($endpoint) ? moduleRoute(
1246 1246
                     $this->moduleName,
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
      */
1259 1259
     protected function getIndexOption($option)
1260 1260
     {
1261
-        return once(function () use ($option) {
1261
+        return once(function() use ($option) {
1262 1262
             $customOptionNamesMapping = [
1263 1263
                 'store' => 'create',
1264 1264
             ];
@@ -1315,8 +1315,8 @@  discard block
 block discarded – undo
1315 1315
     {
1316 1316
         $withImage = $this->moduleHas('medias');
1317 1317
 
1318
-        return $items->map(function ($item) use ($withImage) {
1319
-            $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function ($column) use ($item) {
1318
+        return $items->map(function($item) use ($withImage) {
1319
+            $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function($column) use ($item) {
1320 1320
                 return $this->getItemColumnData($item, $column);
1321 1321
             })->toArray();
1322 1322
 
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
                     $fieldSplitted = explode('|', $field);
1383 1383
                     if (count($fieldSplitted) > 1) {
1384 1384
                         $requestValue = $requestFilters[$key];
1385
-                        Collection::make($fieldSplitted)->each(function ($scopeKey) use (&$scope, $requestValue) {
1385
+                        Collection::make($fieldSplitted)->each(function($scopeKey) use (&$scope, $requestValue) {
1386 1386
                             $scope[$scopeKey] = $requestValue;
1387 1387
                         });
1388 1388
                     } else {
@@ -1558,11 +1558,11 @@  discard block
 block discarded – undo
1558 1558
      */
1559 1559
     protected function validateFormRequest()
1560 1560
     {
1561
-        $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function ($permission, $field) {
1561
+        $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function($permission, $field) {
1562 1562
             return Auth::guard('twill_users')->user()->cannot($permission);
1563 1563
         })->keys();
1564 1564
 
1565
-        $unauthorizedFields->each(function ($field) {
1565
+        $unauthorizedFields->each(function($field) {
1566 1566
             $this->request->offsetUnset($field);
1567 1567
         });
1568 1568
 
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
                 $singularName = Str::singular($name);
1615 1615
                 $modelClass = config('twill.namespace') . '\\Models\\' . Str::studly($singularName);
1616 1616
 
1617
-                if(!class_exists($modelClass)) {
1617
+                if (!class_exists($modelClass)) {
1618 1618
                     $modelClass = $this->getCapsuleByModule($name)['model'];
1619 1619
                 }
1620 1620
 
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
      */
1861 1861
     public function getRepeaterList()
1862 1862
     {
1863
-        return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function ($repeater) {
1863
+        return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function($repeater) {
1864 1864
             return [$repeater['name'] => $repeater];
1865 1865
         });
1866 1866
     }
Please login to merge, or discard this patch.
src/Commands/ModuleMake.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             'hasPosition',
208 208
             'hasRevisions',
209 209
             'hasNesting',
210
-        ])->filter(function ($enabled) {
210
+        ])->filter(function($enabled) {
211 211
             return $enabled;
212 212
         });
213 213
 
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
             $start = "{$delimiters[0]}{$key}{$delimiters[1]}";
832 832
             $end = "{$delimiters[0]}\/{$key}{$delimiters[1]}";
833 833
 
834
-            if ((bool)$value) {
834
+            if ((bool) $value) {
835 835
                 // replace delimiters only
836 836
                 $stub = preg_replace("/$start/", '', $stub);
837 837
                 $stub = preg_replace("/$end/", '', $stub);
Please login to merge, or discard this patch.