Passed
Push — ft/fragments ( 53a8e6...9f6453 )
by Ben
08:26 queued 10s
created
src/Fields/Types/FileField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@
 block discarded – undo
28 28
 
29 29
     public function getMedia(HasAsset $model = null, ?string $locale = null)
30 30
     {
31
-        if(!$model) return [];
31
+        if(!$model) {
32
+            return [];
33
+        }
32 34
 
33 35
         $files = [];
34 36
         $locale = $locale ?? app()->getLocale();
Please login to merge, or discard this patch.
src/Fields/Types/AbstractField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -265,7 +265,9 @@
 block discarded – undo
265 265
     {
266 266
         return function (Model $model = null, $locale = null) {
267 267
 
268
-            if($this->value) return $this->value;
268
+            if($this->value) {
269
+                return $this->value;
270
+            }
269 271
 
270 272
             if (!$model) {
271 273
                 return $this->default;
Please login to merge, or discard this patch.
src/Fields/Types/ImageField.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@
 block discarded – undo
32 32
 
33 33
     public function getMedia(HasAsset $model = null, ?string $locale = null)
34 34
     {
35
-        if(!$model) return [];
35
+        if(!$model) {
36
+            return [];
37
+        }
36 38
 
37 39
         $images = [];
38 40
         $locale = $locale ?? app()->getLocale();
Please login to merge, or discard this patch.
src/DynamicAttributes/HasDynamicAttributes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,9 @@
 block discarded – undo
113 113
             $value = $this->dynamic($key);
114 114
 
115 115
             // If value is localized, we wont return the entire value, but instead return null since no fallback will be provided.
116
-            if(is_array($value) && in_array($locale, $this->dynamicLocales())) return null;
116
+            if(is_array($value) && in_array($locale, $this->dynamicLocales())) {
117
+                return null;
118
+            }
117 119
 
118 120
             return $value;
119 121
         }
Please login to merge, or discard this patch.
src/DynamicAttributes/DynamicAttributes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
 
17 17
     public static function fromRawValue($value): self
18 18
     {
19
-        if($value instanceof self) return $value;
19
+        if($value instanceof self) {
20
+            return $value;
21
+        }
20 22
 
21 23
         $value = is_null($value) ? [] : (is_array($value) ? $value : json_decode($value, true));
22 24
 
Please login to merge, or discard this patch.
src/Fragments/FragmentField.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@  discard block
 block discarded – undo
63 63
                                  ->localizedFormat(':name.:locale')
64 64
                                  ->valueResolver(function($model = null, $locale = null, $field) use($fragment){
65 65
 
66
-                                     if(isset($field->value)) return $field->value;
66
+                                     if(isset($field->value)) {
67
+                                         return $field->value;
68
+                                     }
67 69
 
68 70
                                      if($field instanceof MediaField){
69 71
                                          if(!$fragment->hasModelId()){
@@ -83,7 +85,9 @@  discard block
 block discarded – undo
83 85
 
84 86
     public function getDuplicatableFields(): array
85 87
     {
86
-        if(count($this->getFragments()) < 1) return [];
88
+        if(count($this->getFragments()) < 1) {
89
+            return [];
90
+        }
87 91
 
88 92
         // Take the fields from the first fragment as a starting point for duplication
89 93
         return array_map(function(\Thinktomorrow\Chief\Fields\Types\Field $field){
Please login to merge, or discard this patch.