Test Failed
Pull Request — master (#961)
by Maxim
09:59
created
src/Filters/tests/Model/Schema/InputMapperTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
 
21 21
 final class InputMapperTest extends BaseTestCase
22 22
 {
23
-    private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider;
23
+    private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider;
24 24
     private InputMapper $mapper;
25
-    private m\LegacyMockInterface|m\MockInterface|SchemaProviderInterface $schemaProvider;
25
+    private m\LegacyMockInterface | m\MockInterface | SchemaProviderInterface $schemaProvider;
26 26
 
27 27
     public function setUp(): void
28 28
     {
Please login to merge, or discard this patch.
src/Filters/tests/Model/FilterProviderTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         parent::setUp();
38 38
 
39 39
         $this->container->bindSingleton(ReaderInterface::class, (new Factory())->create());
40
-        $this->container->bindSingleton(SchemaProviderInterface::class, static function (FactoryInterface $factory) {
40
+        $this->container->bindSingleton(SchemaProviderInterface::class, static function (FactoryInterface $factory){
41 41
             return $factory->make(SchemaProvider::class, [
42 42
                 'readers' => [
43 43
                     $factory->make(AttributeReader::class),
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
         parent::setUp();
38 38
 
39 39
         $this->container->bindSingleton(ReaderInterface::class, (new Factory())->create());
40
-        $this->container->bindSingleton(SchemaProviderInterface::class, static function (FactoryInterface $factory) {
40
+        $this->container->bindSingleton(SchemaProviderInterface::class, static function (FactoryInterface $factory)
41
+        {
41 42
             return $factory->make(SchemaProvider::class, [
42 43
                 'readers' => [
43 44
                     $factory->make(AttributeReader::class),
Please login to merge, or discard this patch.
src/Filters/src/Model/Interceptor/Validation/ValidateFilterInterceptor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         $errors = array_merge($core->callAction($controller, $action, $parameters), $parameters['errors'] ?? []);
19 19
         $errorMapper = new ErrorMapper($parameters['schema']);
20 20
 
21
-        if ($errors !== []) {
21
+        if ($errors !== []){
22 22
             throw new ValidationException(
23 23
                 $errorMapper->mapErrors($errors),
24 24
                 $parameters['context'] ?? null
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@
 block discarded – undo
18 18
         $errors = array_merge($core->callAction($controller, $action, $parameters), $parameters['errors'] ?? []);
19 19
         $errorMapper = new ErrorMapper($parameters['schema']);
20 20
 
21
-        if ($errors !== []) {
21
+        if ($errors !== [])
22
+        {
22 23
             throw new ValidationException(
23 24
                 $errorMapper->mapErrors($errors),
24 25
                 $parameters['context'] ?? null
Please login to merge, or discard this patch.
src/Filters/src/Model/Interceptor/Validation/Core.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function __construct(
17 17
         private readonly ContainerInterface $container
18
-    ) {
18
+    ){
19 19
     }
20 20
 
21 21
     public function callAction(string $controller, string $action, array $parameters = []): array
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 
30 30
     private function validateFilter(FilterInterface $filter, array $data, mixed $context = null): array
31 31
     {
32
-        if ($filter instanceof HasFilterDefinition) {
32
+        if ($filter instanceof HasFilterDefinition){
33 33
             $definition = $filter->filterDefinition();
34
-            if ($definition instanceof ShouldBeValidated) {
34
+            if ($definition instanceof ShouldBeValidated){
35 35
                 /** @var ValidationProviderInterface $validationProvider */
36 36
                 $validationProvider = $this->container->get(ValidationProviderInterface::class);
37 37
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,9 +29,11 @@
 block discarded – undo
29 29
 
30 30
     private function validateFilter(FilterInterface $filter, array $data, mixed $context = null): array
31 31
     {
32
-        if ($filter instanceof HasFilterDefinition) {
32
+        if ($filter instanceof HasFilterDefinition)
33
+        {
33 34
             $definition = $filter->filterDefinition();
34
-            if ($definition instanceof ShouldBeValidated) {
35
+            if ($definition instanceof ShouldBeValidated)
36
+            {
35 37
                 /** @var ValidationProviderInterface $validationProvider */
36 38
                 $validationProvider = $this->container->get(ValidationProviderInterface::class);
37 39
 
Please login to merge, or discard this patch.
src/Filters/src/Model/Schema/Builder.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function makeSchema(string $name, array $schema): array
44 44
     {
45
-        if (empty($schema)) {
45
+        if (empty($schema)){
46 46
             throw new SchemaException(\sprintf('Filter `%s` does not define any schema', $name));
47 47
         }
48 48
 
49 49
         $result = [];
50
-        foreach ($schema as $field => $definition) {
50
+        foreach ($schema as $field => $definition){
51 51
             $optional = false;
52 52
 
53 53
             // short definition
54
-            if (\is_string($definition)) {
54
+            if (\is_string($definition)){
55 55
                 // simple scalar field definition
56
-                if (!\class_exists($definition)) {
56
+                if (!\class_exists($definition)){
57 57
                     [$source, $origin] = $this->parseDefinition($field, $definition);
58 58
                     $result[$field] = [
59 59
                         self::SCHEMA_SOURCE => $source,
@@ -74,25 +74,25 @@  discard block
 block discarded – undo
74 74
                 continue;
75 75
             }
76 76
 
77
-            if (!\is_array($definition) || $definition === []) {
77
+            if (!\is_array($definition) || $definition === []){
78 78
                 throw new SchemaException(
79 79
                     \sprintf('Invalid schema definition at `%s`->`%s`', $name, $field)
80 80
                 );
81 81
             }
82 82
 
83 83
             // complex definition
84
-            if (!empty($definition[self::ORIGIN])) {
84
+            if (!empty($definition[self::ORIGIN])){
85 85
                 $origin = $definition[self::ORIGIN];
86 86
 
87 87
                 // [class, 'data:something.*'] vs [class, 'data:something']
88 88
                 $iterate = \str_contains((string)$origin, '.*') || !empty($definition[self::ITERATE]);
89 89
                 $origin = \rtrim($origin, '.*');
90
-            } else {
90
+            }else{
91 91
                 $origin = $field;
92 92
                 $iterate = true;
93 93
             }
94 94
 
95
-            if (!empty($definition[self::OPTIONAL])) {
95
+            if (!empty($definition[self::OPTIONAL])){
96 96
                 $optional = true;
97 97
             }
98 98
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 self::SCHEMA_OPTIONAL => $optional,
106 106
             ];
107 107
 
108
-            if ($iterate) {
108
+            if ($iterate){
109 109
                 [$source, $origin] = $this->parseDefinition($field, $definition[self::ITERATE] ?? $origin);
110 110
 
111 111
                 $map[self::SCHEMA_ITERATE_SOURCE] = $source;
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
             'path',
138 138
             'remoteAddress',
139 139
             'uri'
140
-        ], true)) {
140
+        ], true)){
141 141
             return [$definition, $field];
142 142
         }
143 143
 
144
-        if (!\str_contains($definition, ':')) {
144
+        if (!\str_contains($definition, ':')){
145 145
             return ['data', empty($definition) ? $field : $definition];
146 146
         }
147 147
 
Please login to merge, or discard this patch.
Braces   +23 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,18 +42,22 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function makeSchema(string $name, array $schema): array
44 44
     {
45
-        if (empty($schema)) {
45
+        if (empty($schema))
46
+        {
46 47
             throw new SchemaException(\sprintf('Filter `%s` does not define any schema', $name));
47 48
         }
48 49
 
49 50
         $result = [];
50
-        foreach ($schema as $field => $definition) {
51
+        foreach ($schema as $field => $definition)
52
+        {
51 53
             $optional = false;
52 54
 
53 55
             // short definition
54
-            if (\is_string($definition)) {
56
+            if (\is_string($definition))
57
+            {
55 58
                 // simple scalar field definition
56
-                if (!\class_exists($definition)) {
59
+                if (!\class_exists($definition))
60
+                {
57 61
                     [$source, $origin] = $this->parseDefinition($field, $definition);
58 62
                     $result[$field] = [
59 63
                         self::SCHEMA_SOURCE => $source,
@@ -74,25 +78,30 @@  discard block
 block discarded – undo
74 78
                 continue;
75 79
             }
76 80
 
77
-            if (!\is_array($definition) || $definition === []) {
81
+            if (!\is_array($definition) || $definition === [])
82
+            {
78 83
                 throw new SchemaException(
79 84
                     \sprintf('Invalid schema definition at `%s`->`%s`', $name, $field)
80 85
                 );
81 86
             }
82 87
 
83 88
             // complex definition
84
-            if (!empty($definition[self::ORIGIN])) {
89
+            if (!empty($definition[self::ORIGIN]))
90
+            {
85 91
                 $origin = $definition[self::ORIGIN];
86 92
 
87 93
                 // [class, 'data:something.*'] vs [class, 'data:something']
88 94
                 $iterate = \str_contains((string)$origin, '.*') || !empty($definition[self::ITERATE]);
89 95
                 $origin = \rtrim($origin, '.*');
90
-            } else {
96
+            }
97
+            else
98
+            {
91 99
                 $origin = $field;
92 100
                 $iterate = true;
93 101
             }
94 102
 
95
-            if (!empty($definition[self::OPTIONAL])) {
103
+            if (!empty($definition[self::OPTIONAL]))
104
+            {
96 105
                 $optional = true;
97 106
             }
98 107
 
@@ -105,7 +114,8 @@  discard block
 block discarded – undo
105 114
                 self::SCHEMA_OPTIONAL => $optional,
106 115
             ];
107 116
 
108
-            if ($iterate) {
117
+            if ($iterate)
118
+            {
109 119
                 [$source, $origin] = $this->parseDefinition($field, $definition[self::ITERATE] ?? $origin);
110 120
 
111 121
                 $map[self::SCHEMA_ITERATE_SOURCE] = $source;
@@ -137,11 +147,13 @@  discard block
 block discarded – undo
137 147
             'path',
138 148
             'remoteAddress',
139 149
             'uri'
140
-        ], true)) {
150
+        ], true))
151
+        {
141 152
             return [$definition, $field];
142 153
         }
143 154
 
144
-        if (!\str_contains($definition, ':')) {
155
+        if (!\str_contains($definition, ':'))
156
+        {
145 157
             return ['data', empty($definition) ? $field : $definition];
146 158
         }
147 159
 
Please login to merge, or discard this patch.
src/Filters/src/Model/Schema/InputMapper.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         private readonly FilterProviderInterface $provider,
20 20
         private readonly SchemaProviderInterface $schemaProvider,
21 21
         private readonly FilterFactory $filterFactory
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     public function map(array $mappingSchema, InputInterface $input, array $setters = []): array
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
         $errors = [];
28 28
         $result = $this->mapData($mappingSchema, $input, $setters);
29 29
 
30
-        foreach ($mappingSchema as $field => $map) {
31
-            if (empty($map[Builder::SCHEMA_FILTER])) {
30
+        foreach ($mappingSchema as $field => $map){
31
+            if (empty($map[Builder::SCHEMA_FILTER])){
32 32
                 continue;
33 33
             }
34 34
 
35 35
             $nested = $map[Builder::SCHEMA_FILTER];
36
-            if (empty($map[Builder::SCHEMA_ARRAY])) {
36
+            if (empty($map[Builder::SCHEMA_ARRAY])){
37 37
                 // slicing down
38
-                try {
38
+                try{
39 39
                     $result[$field] = $this->provider->createFilter($nested, $input->withPrefix($map[Builder::SCHEMA_ORIGIN]));
40
-                } catch (ValidationException $e) {
40
+                }catch (ValidationException $e){
41 41
                     $errors[$field] = $e->errors;
42 42
                     unset($result[$field]);
43 43
                 }
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
             $values = [];
48 48
 
49 49
             // List of "key" => "location in request"
50
-            foreach ($this->iterate($map, $input) as $index => $origin) {
51
-                try {
50
+            foreach ($this->iterate($map, $input) as $index => $origin){
51
+                try{
52 52
                     $values[$index] = $this->provider->createFilter($nested, $input->withPrefix($origin));
53
-                } catch (ValidationException $e) {
53
+                }catch (ValidationException $e){
54 54
                     $errors[$field][$index] = $e->errors;
55 55
                 }
56 56
             }
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
     public function mapData(array $mappingSchema, InputInterface $input, array $setters = []): array
65 65
     {
66 66
         $result = [];
67
-        foreach ($mappingSchema as $field => $map) {
68
-            if (empty($map[Builder::SCHEMA_FILTER])) {
67
+        foreach ($mappingSchema as $field => $map){
68
+            if (empty($map[Builder::SCHEMA_FILTER])){
69 69
                 $value = $input->getValue($map[Builder::SCHEMA_SOURCE], $map[Builder::SCHEMA_ORIGIN]);
70 70
 
71
-                if ($value !== null) {
71
+                if ($value !== null){
72 72
                     /** @var Setter $setter */
73
-                    foreach ($setters[$field] ?? [] as $setter) {
73
+                    foreach ($setters[$field] ?? [] as $setter){
74 74
                         $value = $setter->updateValue($value);
75 75
                     }
76 76
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 continue;
80 80
             }
81 81
 
82
-            if (empty($map[Builder::SCHEMA_ARRAY])) {
82
+            if (empty($map[Builder::SCHEMA_ARRAY])){
83 83
                 $filter = $this->filterFactory->createFilterInstance($map[Builder::SCHEMA_FILTER]);
84 84
                 $result[$field] = $this->mapData(
85 85
                     $this->schemaProvider->getSchema($filter),
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             $schema[Builder::SCHEMA_ITERATE_ORIGIN]
103 103
         );
104 104
 
105
-        if (empty($values) || !\is_array($values)) {
105
+        if (empty($values) || !\is_array($values)){
106 106
             return [];
107 107
         }
108 108
 
109
-        foreach (\array_keys($values) as $key) {
110
-            yield $key => $schema[Builder::SCHEMA_ORIGIN] . '.' . $key;
109
+        foreach (\array_keys($values) as $key){
110
+            yield $key => $schema[Builder::SCHEMA_ORIGIN].'.'.$key;
111 111
         }
112 112
     }
113 113
 }
Please login to merge, or discard this patch.
Braces   +32 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,17 +27,23 @@  discard block
 block discarded – undo
27 27
         $errors = [];
28 28
         $result = $this->mapData($mappingSchema, $input, $setters);
29 29
 
30
-        foreach ($mappingSchema as $field => $map) {
31
-            if (empty($map[Builder::SCHEMA_FILTER])) {
30
+        foreach ($mappingSchema as $field => $map)
31
+        {
32
+            if (empty($map[Builder::SCHEMA_FILTER]))
33
+            {
32 34
                 continue;
33 35
             }
34 36
 
35 37
             $nested = $map[Builder::SCHEMA_FILTER];
36
-            if (empty($map[Builder::SCHEMA_ARRAY])) {
38
+            if (empty($map[Builder::SCHEMA_ARRAY]))
39
+            {
37 40
                 // slicing down
38
-                try {
41
+                try
42
+                {
39 43
                     $result[$field] = $this->provider->createFilter($nested, $input->withPrefix($map[Builder::SCHEMA_ORIGIN]));
40
-                } catch (ValidationException $e) {
44
+                }
45
+                catch (ValidationException $e)
46
+                {
41 47
                     $errors[$field] = $e->errors;
42 48
                     unset($result[$field]);
43 49
                 }
@@ -47,10 +53,14 @@  discard block
 block discarded – undo
47 53
             $values = [];
48 54
 
49 55
             // List of "key" => "location in request"
50
-            foreach ($this->iterate($map, $input) as $index => $origin) {
51
-                try {
56
+            foreach ($this->iterate($map, $input) as $index => $origin)
57
+            {
58
+                try
59
+                {
52 60
                     $values[$index] = $this->provider->createFilter($nested, $input->withPrefix($origin));
53
-                } catch (ValidationException $e) {
61
+                }
62
+                catch (ValidationException $e)
63
+                {
54 64
                     $errors[$field][$index] = $e->errors;
55 65
                 }
56 66
             }
@@ -64,13 +74,17 @@  discard block
 block discarded – undo
64 74
     public function mapData(array $mappingSchema, InputInterface $input, array $setters = []): array
65 75
     {
66 76
         $result = [];
67
-        foreach ($mappingSchema as $field => $map) {
68
-            if (empty($map[Builder::SCHEMA_FILTER])) {
77
+        foreach ($mappingSchema as $field => $map)
78
+        {
79
+            if (empty($map[Builder::SCHEMA_FILTER]))
80
+            {
69 81
                 $value = $input->getValue($map[Builder::SCHEMA_SOURCE], $map[Builder::SCHEMA_ORIGIN]);
70 82
 
71
-                if ($value !== null) {
83
+                if ($value !== null)
84
+                {
72 85
                     /** @var Setter $setter */
73
-                    foreach ($setters[$field] ?? [] as $setter) {
86
+                    foreach ($setters[$field] ?? [] as $setter)
87
+                    {
74 88
                         $value = $setter->updateValue($value);
75 89
                     }
76 90
 
@@ -79,7 +93,8 @@  discard block
 block discarded – undo
79 93
                 continue;
80 94
             }
81 95
 
82
-            if (empty($map[Builder::SCHEMA_ARRAY])) {
96
+            if (empty($map[Builder::SCHEMA_ARRAY]))
97
+            {
83 98
                 $filter = $this->filterFactory->createFilterInstance($map[Builder::SCHEMA_FILTER]);
84 99
                 $result[$field] = $this->mapData(
85 100
                     $this->schemaProvider->getSchema($filter),
@@ -102,11 +117,13 @@  discard block
 block discarded – undo
102 117
             $schema[Builder::SCHEMA_ITERATE_ORIGIN]
103 118
         );
104 119
 
105
-        if (empty($values) || !\is_array($values)) {
120
+        if (empty($values) || !\is_array($values))
121
+        {
106 122
             return [];
107 123
         }
108 124
 
109
-        foreach (\array_keys($values) as $key) {
125
+        foreach (\array_keys($values) as $key)
126
+        {
110 127
             yield $key => $schema[Builder::SCHEMA_ORIGIN] . '.' . $key;
111 128
         }
112 129
     }
Please login to merge, or discard this patch.
src/Filters/src/Model/Schema/SchemaProvider.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
     public function __construct(
29 29
         private readonly array $readers,
30 30
         private readonly Builder $schemaBuilder
31
-    ) {
31
+    ){
32 32
     }
33 33
 
34 34
     public function getSchema(FilterInterface $filter): array
35 35
     {
36
-        if (!isset($this->schema[$filter::class])) {
36
+        if (!isset($this->schema[$filter::class])){
37 37
             $this->read($filter);
38 38
         }
39 39
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function getSetters(FilterInterface $filter): array
44 44
     {
45
-        if (!isset($this->setters[$filter::class])) {
45
+        if (!isset($this->setters[$filter::class])){
46 46
             $this->read($filter);
47 47
         }
48 48
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $this->schema[$filter::class] = [];
55 55
         $this->setters[$filter::class] = [];
56
-        foreach ($this->readers as $reader) {
56
+        foreach ($this->readers as $reader){
57 57
             [$readSchema, $readSetters] = $reader->read($filter);
58 58
             $this->schema[$filter::class] = \array_merge($this->schema[$filter::class], $readSchema);
59 59
             $this->setters[$filter::class] = \array_merge($this->setters[$filter::class], $readSetters);
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function getSchema(FilterInterface $filter): array
35 35
     {
36
-        if (!isset($this->schema[$filter::class])) {
36
+        if (!isset($this->schema[$filter::class]))
37
+        {
37 38
             $this->read($filter);
38 39
         }
39 40
 
@@ -42,7 +43,8 @@  discard block
 block discarded – undo
42 43
 
43 44
     public function getSetters(FilterInterface $filter): array
44 45
     {
45
-        if (!isset($this->setters[$filter::class])) {
46
+        if (!isset($this->setters[$filter::class]))
47
+        {
46 48
             $this->read($filter);
47 49
         }
48 50
 
@@ -53,7 +55,8 @@  discard block
 block discarded – undo
53 55
     {
54 56
         $this->schema[$filter::class] = [];
55 57
         $this->setters[$filter::class] = [];
56
-        foreach ($this->readers as $reader) {
58
+        foreach ($this->readers as $reader)
59
+        {
57 60
             [$readSchema, $readSetters] = $reader->read($filter);
58 61
             $this->schema[$filter::class] = \array_merge($this->schema[$filter::class], $readSchema);
59 62
             $this->setters[$filter::class] = \array_merge($this->setters[$filter::class], $readSetters);
Please login to merge, or discard this patch.
src/Filters/src/Model/Schema/AttributeReader.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public function __construct(
21 21
         private readonly AttributesReader $reader
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     /**
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
         $setters = [];
34 34
         $class = new \ReflectionClass($filter);
35 35
 
36
-        foreach ($class->getProperties() as $property) {
36
+        foreach ($class->getProperties() as $property){
37 37
             /** @var object $attribute */
38
-            foreach ($this->reader->getPropertyMetadata($property) as $attribute) {
39
-                if ($attribute instanceof AbstractInput || $attribute instanceof NestedFilter) {
38
+            foreach ($this->reader->getPropertyMetadata($property) as $attribute){
39
+                if ($attribute instanceof AbstractInput || $attribute instanceof NestedFilter){
40 40
                     $schema[$property->getName()] = $attribute->getSchema($property);
41
-                } elseif ($attribute instanceof NestedArray) {
41
+                } elseif ($attribute instanceof NestedArray){
42 42
                     $prefix = $attribute->input->key ?? $attribute->prefix ?? $property->getName();
43
-                    $schema[$property->getName()] = [$attribute->class, $prefix . '.*'];
44
-                } elseif ($attribute instanceof Setter) {
43
+                    $schema[$property->getName()] = [$attribute->class, $prefix.'.*'];
44
+                } elseif ($attribute instanceof Setter){
45 45
                     $setters[$property->getName()][] = $attribute;
46 46
                 }
47 47
             }
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,15 +33,22 @@
 block discarded – undo
33 33
         $setters = [];
34 34
         $class = new \ReflectionClass($filter);
35 35
 
36
-        foreach ($class->getProperties() as $property) {
36
+        foreach ($class->getProperties() as $property)
37
+        {
37 38
             /** @var object $attribute */
38
-            foreach ($this->reader->getPropertyMetadata($property) as $attribute) {
39
-                if ($attribute instanceof AbstractInput || $attribute instanceof NestedFilter) {
39
+            foreach ($this->reader->getPropertyMetadata($property) as $attribute)
40
+            {
41
+                if ($attribute instanceof AbstractInput || $attribute instanceof NestedFilter)
42
+                {
40 43
                     $schema[$property->getName()] = $attribute->getSchema($property);
41
-                } elseif ($attribute instanceof NestedArray) {
44
+                }
45
+                elseif ($attribute instanceof NestedArray)
46
+                {
42 47
                     $prefix = $attribute->input->key ?? $attribute->prefix ?? $property->getName();
43 48
                     $schema[$property->getName()] = [$attribute->class, $prefix . '.*'];
44
-                } elseif ($attribute instanceof Setter) {
49
+                }
50
+                elseif ($attribute instanceof Setter)
51
+                {
45 52
                     $setters[$property->getName()][] = $attribute;
46 53
                 }
47 54
             }
Please login to merge, or discard this patch.
src/Filters/src/Model/Mapper/SetterRegistry.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
     public function __construct(array $setters = [])
13 13
     {
14
-        foreach ($setters as $setter) {
14
+        foreach ($setters as $setter){
15 15
             $this->register($setter);
16 16
         }
17 17
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,8 @@
 block discarded – undo
11 11
 
12 12
     public function __construct(array $setters = [])
13 13
     {
14
-        foreach ($setters as $setter) {
14
+        foreach ($setters as $setter)
15
+        {
15 16
             $this->register($setter);
16 17
         }
17 18
     }
Please login to merge, or discard this patch.