Passed
Push — master ( e1e679...09e224 )
by Quentin
10:29
created
src/Repositories/Behaviors/HandleTranslations.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
 
24 24
             $submittedLanguages = Collection::make($fields['languages'] ?? []);
25 25
 
26
-            $atLeastOneLanguageIsPublished = $submittedLanguages->contains(function ($language) {
26
+            $atLeastOneLanguageIsPublished = $submittedLanguages->contains(function($language) {
27 27
                 return $language['published'];
28 28
             });
29 29
 
30 30
             foreach ($locales as $index => $locale) {
31
-                $submittedLanguage = Arr::first($submittedLanguages->filter(function ($lang) use ($locale) {
31
+                $submittedLanguage = Arr::first($submittedLanguages->filter(function($lang) use ($locale) {
32 32
                     return $lang['value'] == $locale;
33 33
                 }));
34 34
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
                 $fields[$locale] = [
40 40
                     'active' => $activeField,
41
-                ] + $attributes->mapWithKeys(function ($attribute) use (&$fields, $locale, $localesCount, $index) {
41
+                ] + $attributes->mapWithKeys(function($attribute) use (&$fields, $locale, $localesCount, $index) {
42 42
                     $attributeValue = $fields[$attribute] ?? null;
43 43
 
44 44
                     // if we are at the last locale,
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         if ($this->model->isTranslatable()) {
81 81
             $attributes = $this->model->translatedAttributes;
82
-            $query->whereHas('translations', function ($q) use ($scopes, $attributes) {
82
+            $query->whereHas('translations', function($q) use ($scopes, $attributes) {
83 83
                 foreach ($attributes as $attribute) {
84 84
                     if (isset($scopes[$attribute]) && is_string($scopes[$attribute])) {
85 85
                         $q->where($attribute, 'like', '%' . $scopes[$attribute] . '%');
Please login to merge, or discard this patch.
src/Repositories/Behaviors/HandleBrowsers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function getFormFieldsForBrowser($object, $relation, $routePrefix = null, $titleKey = 'title', $moduleName = null)
109 109
     {
110
-        return $object->$relation->map(function ($relatedElement) use ($titleKey, $routePrefix, $relation, $moduleName) {
110
+        return $object->$relation->map(function($relatedElement) use ($titleKey, $routePrefix, $relation, $moduleName) {
111 111
             return [
112 112
                 'id' => $relatedElement->id,
113 113
                 'name' => $relatedElement->titleInBrowser ?? $relatedElement->$titleKey,
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getFormFieldsForRelatedBrowser($object, $relation)
128 128
     {
129
-        return $object->getRelated($relation)->map(function ($relatedElement) {
129
+        return $object->getRelated($relation)->map(function($relatedElement) {
130 130
             return ($relatedElement != null) ? [
131 131
                 'id' => $relatedElement->id,
132 132
                 'name' => $relatedElement->titleInBrowser ?? $relatedElement->title,
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             ]) + (classHasTrait($relatedElement, HasMedias::class) ? [
137 137
                 'thumbnail' => $relatedElement->defaultCmsImage(['w' => 100, 'h' => 100]),
138 138
             ] : []) : [];
139
-        })->reject(function ($item) {
139
+        })->reject(function($item) {
140 140
             return empty($item);
141 141
         })->values()->toArray();
142 142
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     protected function getBrowsers()
151 151
     {
152
-        return collect($this->browsers)->map(function ($browser, $key) {
152
+        return collect($this->browsers)->map(function($browser, $key) {
153 153
             $browserName = is_string($browser) ? $browser : $key;
154 154
             $moduleName = !empty($browser['moduleName']) ? $browser['moduleName'] : $this->inferModuleNameFromBrowserName($browserName);
155 155
             
Please login to merge, or discard this patch.
src/Repositories/Behaviors/HandleRevisions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
     public function hydrateHandleRevisions($object, $fields)
12 12
     {
13 13
         // HandleRepeaters trait => getRepeaters
14
-        foreach($this->getRepeaters() as $repeater) {
14
+        foreach ($this->getRepeaters() as $repeater) {
15 15
             $this->hydrateRepeater($object, $fields, $repeater['relation'], $repeater['model']);
16 16
         }
17 17
 
18 18
         // HandleBrowers trait => getBrowsers
19
-        foreach($this->getBrowsers() as $browser) {
19
+        foreach ($this->getBrowsers() as $browser) {
20 20
             $this->hydrateBrowser($object, $fields, $browser['relation'], $browser['positionAttribute'], $browser['model']);
21 21
         }
22 22
 
Please login to merge, or discard this patch.
src/Helpers/frontend_helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         if (!app()->environment('local', 'development')) {
13 13
             try {
14
-                $manifest = Cache::rememberForever('rev-manifest', function () {
14
+                $manifest = Cache::rememberForever('rev-manifest', function() {
15 15
                     return json_decode(file_get_contents(config('twill.frontend.rev_manifest_path')), true);
16 16
                 });
17 17
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         try {
56
-            $manifest = Cache::rememberForever('twill-manifest', function () {
56
+            $manifest = Cache::rememberForever('twill-manifest', function() {
57 57
                 return json_decode(file_get_contents(
58 58
                     public_path(config('twill.public_directory', 'twill'))
59 59
                     . '/'
Please login to merge, or discard this patch.
src/TwillServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
         }
125 125
 
126 126
         if (config('twill.enabled.media-library')) {
127
-            $this->app->singleton('imageService', function () {
127
+            $this->app->singleton('imageService', function() {
128 128
                 return $this->app->make(config('twill.media_library.image_service'));
129 129
             });
130 130
         }
131 131
 
132 132
         if (config('twill.enabled.file-library')) {
133
-            $this->app->singleton('fileService', function () {
133
+            $this->app->singleton('fileService', function() {
134 134
                 return $this->app->make(config('twill.file_library.file_service'));
135 135
             });
136 136
         }
@@ -307,20 +307,20 @@  discard block
 block discarded – undo
307 307
     {
308 308
         $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();
309 309
 
310
-        $blade->directive('dd', function ($param) {
310
+        $blade->directive('dd', function($param) {
311 311
             return "<?php dd({$param}); ?>";
312 312
         });
313 313
 
314
-        $blade->directive('dumpData', function ($data) {
314
+        $blade->directive('dumpData', function($data) {
315 315
             return sprintf("<?php (new Symfony\Component\VarDumper\VarDumper)->dump(%s); exit; ?>",
316 316
                 null != $data ? $data : "get_defined_vars()");
317 317
         });
318 318
 
319
-        $blade->directive('formField', function ($expression) {
319
+        $blade->directive('formField', function($expression) {
320 320
             return $this->includeView('partials.form._', $expression);
321 321
         });
322 322
 
323
-        $blade->directive('partialView', function ($expression) {
323
+        $blade->directive('partialView', function($expression) {
324 324
 
325 325
             $expressionAsArray = str_getcsv($expression, ',', '\'');
326 326
 
@@ -356,13 +356,13 @@  discard block
 block discarded – undo
356 356
             ?>";
357 357
         });
358 358
 
359
-        $blade->directive('pushonce', function ($expression) {
359
+        $blade->directive('pushonce', function($expression) {
360 360
             list($pushName, $pushSub) = explode(':', trim(substr($expression, 1, -1)));
361 361
             $key = '__pushonce_' . $pushName . '_' . str_replace('-', '_', $pushSub);
362 362
             return "<?php if(! isset(\$__env->{$key})): \$__env->{$key} = 1; \$__env->startPush('{$pushName}'); ?>";
363 363
         });
364 364
 
365
-        $blade->directive('endpushonce', function () {
365
+        $blade->directive('endpushonce', function() {
366 366
             return '<?php $__env->stopPush(); endif; ?>';
367 367
         });
368 368
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
         View::composer('twill::partials.navigation.*', ActiveNavigation::class);
396 396
 
397
-        View::composer(['admin.*', 'templates.*', 'twill::*'], function ($view) {
397
+        View::composer(['admin.*', 'templates.*', 'twill::*'], function($view) {
398 398
             $with = array_merge([
399 399
                 'renderForBlocks' => false,
400 400
                 'renderForModal' => false,
Please login to merge, or discard this patch.