Passed
Pull Request — master (#532)
by Antonio Carlos
10:20
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/Models/Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
     public function scopeVisible($query)
35 35
     {
36 36
         if ($this->isFillable('publish_start_date')) {
37
-            $query->where(function ($query) {
37
+            $query->where(function($query) {
38 38
                 $query->whereNull('publish_start_date')->orWhere('publish_start_date', '<=', Carbon::now());
39 39
             });
40 40
 
41 41
             if ($this->isFillable('publish_end_date')) {
42
-                $query->where(function ($query) {
42
+                $query->where(function($query) {
43 43
                     $query->whereNull('publish_end_date')->orWhere('publish_end_date', '>=', Carbon::now());
44 44
                 });
45 45
             }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         // Use the list of translatable attributes on our base model
75 75
         if (
76 76
             blank($fillable) &&
77
-            Str::contains($class= get_class($this), 'Models\Translations') &&
77
+            Str::contains($class = get_class($this), 'Models\Translations') &&
78 78
             property_exists($class, 'baseModuleModel')
79 79
         ) {
80 80
             $fillable = (new $this->baseModuleModel)->getTranslatedAttributes();
Please login to merge, or discard this patch.