Test Failed
Pull Request — master (#868)
by butschster
16:38
created
src/Filters/src/Model/Schema/AttributeMapper.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function __construct(
23 23
         private readonly FilterProviderInterface $provider,
24 24
         private readonly ReaderInterface $reader
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     /**
@@ -36,46 +36,46 @@  discard block
 block discarded – undo
36 36
         $schema = [];
37 37
         $class = new \ReflectionClass($filter);
38 38
 
39
-        foreach ($class->getProperties() as $property) {
40
-            foreach ($this->reader->getPropertyMetadata($property) as $attribute) {
41
-                if ($attribute instanceof AbstractInput) {
39
+        foreach ($class->getProperties() as $property){
40
+            foreach ($this->reader->getPropertyMetadata($property) as $attribute){
41
+                if ($attribute instanceof AbstractInput){
42 42
                     $this->setValue($filter, $property, $attribute->getValue($input, $property));
43 43
                     $schema[$property->getName()] = $attribute->getSchema($property);
44
-                } elseif ($attribute instanceof NestedFilter) {
44
+                } elseif ($attribute instanceof NestedFilter){
45 45
                     $prefix = $attribute->prefix ?? $property->name;
46
-                    try {
46
+                    try{
47 47
                         $value = $this->provider->createFilter(
48 48
                             $attribute->class,
49 49
                             $input->withPrefix($prefix)
50 50
                         );
51 51
 
52 52
                         $this->setValue($filter, $property, $value);
53
-                    } catch (ValidationException $e) {
53
+                    }catch (ValidationException $e){
54 54
                         $errors[$prefix] = $e->errors;
55 55
                     }
56 56
 
57 57
                     $schema[$property->getName()] = $attribute->getSchema($property);
58
-                } elseif ($attribute instanceof NestedArray) {
58
+                } elseif ($attribute instanceof NestedArray){
59 59
                     $values = $attribute->getValue($input, $property);
60 60
                     $propertyValues = [];
61 61
 
62 62
                     $prefix = $attribute->input->key ?? $attribute->prefix ?? $property->getName();
63 63
 
64
-                    if (\is_array($values)) {
65
-                        foreach (\array_keys($values) as $key) {
66
-                            try {
64
+                    if (\is_array($values)){
65
+                        foreach (\array_keys($values) as $key){
66
+                            try{
67 67
                                 $propertyValues[$key] = $this->provider->createFilter(
68 68
                                     $attribute->class,
69
-                                    $input->withPrefix($prefix . '.' . $key)
69
+                                    $input->withPrefix($prefix.'.'.$key)
70 70
                                 );
71
-                            } catch (ValidationException $e) {
71
+                            }catch (ValidationException $e){
72 72
                                 $errors[$property->getName()][$key] = $e->errors;
73 73
                             }
74 74
                         }
75 75
                     }
76 76
 
77 77
                     $this->setValue($filter, $property, $propertyValues);
78
-                    $schema[$property->getName()] = [$attribute->class, $prefix . '.*'];
78
+                    $schema[$property->getName()] = [$attribute->class, $prefix.'.*'];
79 79
                 }
80 80
             }
81 81
         }
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $setter = $this->reader->firstPropertyMetadata($property, Setter::class);
89 89
 
90
-        if ($value === null) {
90
+        if ($value === null){
91 91
             return;
92 92
         }
93 93
 
94
-        if ($setter) {
94
+        if ($setter){
95 95
             $value = $setter->updateValue($value);
96 96
         }
97 97
 
Please login to merge, or discard this patch.
src/Filters/src/Model/Interceptor/ValidateFilterInterceptor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 {
25 25
     public function __construct(
26 26
         private readonly ContainerInterface $container
27
-    ) {
27
+    ){
28 28
     }
29 29
 
30 30
     /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $bag = $parameters['filterBag'];
36 36
         $filter = $core->callAction($controller, $action, $parameters);
37 37
 
38
-        if ($filter instanceof HasFilterDefinition) {
38
+        if ($filter instanceof HasFilterDefinition){
39 39
             $this->validateFilter(
40 40
                 $filter->filterDefinition(),
41 41
                 $bag,
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         array $errors,
54 54
         mixed $context
55 55
     ): void {
56
-        if ($definition instanceof ShouldBeValidated) {
56
+        if ($definition instanceof ShouldBeValidated){
57 57
             $errorMapper = new ErrorMapper($bag->schema);
58 58
             $validationProvider = $this->container->get(ValidationProviderInterface::class);
59 59
 
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
                 ->getValidation($definition::class)
62 62
                 ->validate($bag, $definition->validationRules(), $context);
63 63
 
64
-            if (!$validator->isValid()) {
64
+            if (!$validator->isValid()){
65 65
                 throw new ValidationException(
66 66
                     $errorMapper->mapErrors(\array_merge($errors, $validator->getErrors())),
67 67
                     $context
68 68
                 );
69
-            } elseif ($errors !== []) {
69
+            } elseif ($errors !== []){
70 70
                 throw new ValidationException($errorMapper->mapErrors($errors), $context);
71 71
             }
72 72
         }
Please login to merge, or discard this patch.