Passed
Push — fix/media-validation ( 732083...34b116 )
by Ben
06:22
created
src/Media/Application/AbstractMediaFieldHandler.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
             return $filename;
117 117
         }
118 118
 
119
-        $extension = substr($filename, strrpos($filename, '.') + 1);
119
+        $extension = substr($filename, strrpos($filename, '.')+1);
120 120
         $filename = substr($filename, 0, strrpos($filename, '.'));
121 121
 
122
-        return Str::slug($filename) . '.' . $extension;
122
+        return Str::slug($filename).'.'.$extension;
123 123
     }
124 124
 
125 125
     protected function sort(HasAsset $model, MediaField $field, Request $request)
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
     {
146 146
         $values = isset($fileIdInput[$key])
147 147
             ? $fileIdInput[$key]
148
-            : (isset($fileIdInput['files-' . $key])
149
-                ? $fileIdInput['files-' . $key]
148
+            : (isset($fileIdInput['files-'.$key])
149
+                ? $fileIdInput['files-'.$key]
150 150
                 : ''
151 151
             );
152 152
 
153
-        if(!$values) return [];
153
+        if (!$values) return [];
154 154
 
155 155
         return explode(',', $values);
156 156
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,9 @@
 block discarded – undo
150 150
                 : ''
151 151
             );
152 152
 
153
-        if(!$values) return [];
153
+        if(!$values) {
154
+            return [];
155
+        }
154 156
 
155 157
         return explode(',', $values);
156 158
     }
Please login to merge, or discard this patch.
src/Fields/SavingFields.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             }
30 30
 
31 31
             // Custom set methods - default is the generic setField() method.
32
-            $methodName = 'set' . ucfirst(Str::camel($field->getKey())) . 'Field';
32
+            $methodName = 'set'.ucfirst(Str::camel($field->getKey())).'Field';
33 33
             (method_exists($this, $methodName))
34 34
                 ? $this->$methodName($field, $request)
35 35
                 : $this->setField($field, $request);
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
     protected function detectCustomSaveMethods(Field $field): bool
48 48
     {
49
-        $saveMethodByKey = 'save' . ucfirst(Str::camel($field->getKey())) . 'Field';
50
-        $saveMethodByType = 'save' . ucfirst(Str::camel($field->getType()->get())) . 'Fields';
49
+        $saveMethodByKey = 'save'.ucfirst(Str::camel($field->getKey())).'Field';
50
+        $saveMethodByType = 'save'.ucfirst(Str::camel($field->getType()->get())).'Fields';
51 51
 
52 52
         foreach ([$saveMethodByKey, $saveMethodByType] as $saveMethod) {
53 53
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             // Make our media fields able to be translatable as well...
97 97
             if ($field->ofType(FieldType::FILE, FieldType::IMAGE)) {
98
-                throw new \Exception('Cannot process the ' . $field->getKey() . ' media field. Currently no support for translatable media files. We should fix this!');
98
+                throw new \Exception('Cannot process the '.$field->getKey().' media field. Currently no support for translatable media files. We should fix this!');
99 99
             }
100 100
 
101 101
             // Okay so this is a bit odd but since all translations are expected to be inside the trans
Please login to merge, or discard this patch.