Test Failed
Push — fix/media-validation ( 3351fe )
by Ben
09:34
created
src/Fields/Validation/FieldValidator.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@
 block discarded – undo
50 50
 
51 51
     private function matrix(array $keys, array $values): array
52 52
     {
53
-        if(empty($values)) return [];
53
+        if(empty($values)) {
54
+            return [];
55
+        }
54 56
 
55 57
         return array_fill_keys($keys, reset($values));
56 58
     }
Please login to merge, or discard this patch.
src/Fields/ValidationRules/AbstractMediaFieldRule.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
     {
15 15
         $payload = $this->emptyPayload();
16 16
 
17
-        if(!$value || !is_array($value)) return $payload;
17
+        if(!$value || !is_array($value)) {
18
+            return $payload;
19
+        }
18 20
 
19 21
         foreach([MediaRequest::NEW, MediaRequest::REPLACE, MediaRequest::DETACH] as $action) {
20 22
             if(isset($value[$action])){
Please login to merge, or discard this patch.
src/Fields/ValidationRules/ValidatesExistingAssetAttributes.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
     protected function refersToExistingAsset($value): bool
11 11
     {
12 12
         // Faster check to see if there is an asset id passed or not.
13
-        if(is_string($value) && $this->isValidJson($value)) return false;
13
+        if(is_string($value) && $this->isValidJson($value)) {
14
+            return false;
15
+        }
14 16
 
15 17
         return !is_null($this->existingAsset($value));
16 18
     }
Please login to merge, or discard this patch.
src/Media/Application/AbstractMediaFieldHandler.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@
 block discarded – undo
31 31
      */
32 32
     protected function sluggifyFilename(string $filename): string
33 33
     {
34
-        if(false === strpos($filename, '.')) return $filename;
34
+        if(false === strpos($filename, '.')) {
35
+            return $filename;
36
+        }
35 37
 
36 38
         $extension = substr($filename, strrpos($filename, '.') + 1);
37 39
         $filename = substr($filename, 0, strrpos($filename, '.'));
Please login to merge, or discard this patch.
src/Media/Application/ImageFieldHandler.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
                 foreach($files as $k => $file) {
34 34
 
35 35
                     // If the passed value is null, we do not want to process it.
36
-                    if(!$file) continue;
36
+                    if(!$file) {
37
+                        continue;
38
+                    }
37 39
 
38 40
                     $mediaRequest->add($action, new MediaRequestInput(
39 41
                         $file, $locale, $field->getKey(), ['index' => $k] // index key is used for e.g. replace method to indicate the current asset id
Please login to merge, or discard this patch.