Test Failed
Pull Request — master (#906)
by Maxim
08:20
created
src/Stempler/src/Node/Hidden.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     /** @param TNode[] $nodes */
18 18
     public function __construct(
19 19
         public array $nodes
20
-    ) {
20
+    ){
21 21
     }
22 22
 
23 23
     public function getIterator(): \Generator
Please login to merge, or discard this patch.
src/Stempler/src/Traverser.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function __construct(array $visitors = [])
21 21
     {
22
-        foreach ($visitors as $visitor) {
22
+        foreach ($visitors as $visitor){
23 23
             $this->addVisitor($visitor);
24 24
         }
25 25
     }
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function removeVisitor(VisitorInterface $visitor): void
36 36
     {
37
-        foreach ($this->visitors as $index => $added) {
38
-            if ($added === $visitor) {
37
+        foreach ($this->visitors as $index => $added){
38
+            if ($added === $visitor){
39 39
                 unset($this->visitors[$index]);
40 40
                 break;
41 41
             }
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
         $context ??= new VisitorContext();
57 57
 
58 58
         $ctx = clone $context;
59
-        foreach ($nodes as $index => $node) {
60
-            if ($this->stopTraversal) {
59
+        foreach ($nodes as $index => $node){
60
+            if ($this->stopTraversal){
61 61
                 break;
62 62
             }
63 63
 
64 64
             $traverseChildren = true;
65 65
             $breakVisitorID = null;
66 66
 
67
-            if ($node instanceof NodeInterface) {
67
+            if ($node instanceof NodeInterface){
68 68
                 $ctx = $context->withNode($node);
69 69
             }
70 70
 
71
-            foreach ($this->visitors as $visitorID => $visitor) {
71
+            foreach ($this->visitors as $visitorID => $visitor){
72 72
                 $result = $visitor->enterNode($node, $ctx);
73 73
 
74
-                switch (true) {
74
+                switch (true){
75 75
                     case $result === null:
76 76
                         break;
77 77
 
@@ -95,23 +95,23 @@  discard block
 block discarded – undo
95 95
 
96 96
                     default:
97 97
                         throw new \LogicException(
98
-                            'enterNode() returned invalid value of type ' . \gettype($result)
98
+                            'enterNode() returned invalid value of type '.\gettype($result)
99 99
                         );
100 100
                 }
101 101
             }
102 102
 
103 103
             // sub nodes
104
-            if ($traverseChildren && $node instanceof NodeInterface) {
104
+            if ($traverseChildren && $node instanceof NodeInterface){
105 105
                 $nodes[$index] = $this->traverseNode($node, $ctx);
106
-                if ($this->stopTraversal) {
106
+                if ($this->stopTraversal){
107 107
                     break;
108 108
                 }
109 109
             }
110 110
 
111
-            foreach ($this->visitors as $visitorID => $visitor) {
111
+            foreach ($this->visitors as $visitorID => $visitor){
112 112
                 $result = $visitor->leaveNode($node, $ctx);
113 113
 
114
-                switch (true) {
114
+                switch (true){
115 115
                     case $result === null:
116 116
                         break;
117 117
 
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 
130 130
                     default:
131 131
                         throw new \LogicException(
132
-                            'leaveNode() returned invalid value of type ' . gettype($result)
132
+                            'leaveNode() returned invalid value of type '.gettype($result)
133 133
                         );
134 134
                 }
135 135
 
136
-                if ($breakVisitorID === $visitorID) {
136
+                if ($breakVisitorID === $visitorID){
137 137
                     break;
138 138
                 }
139 139
             }
@@ -148,18 +148,18 @@  discard block
 block discarded – undo
148 148
     private function traverseNode(NodeInterface $node, VisitorContext $context): NodeInterface
149 149
     {
150 150
         $ctx = clone $context;
151
-        foreach ($node as $name => $_) {
151
+        foreach ($node as $name => $_){
152 152
             $_child = &$node->$name;
153
-            if (\is_array($_child)) {
153
+            if (\is_array($_child)){
154 154
                 $_child = $this->traverse($_child, $ctx);
155
-                if ($this->stopTraversal) {
155
+                if ($this->stopTraversal){
156 156
                     break;
157 157
                 }
158 158
 
159 159
                 continue;
160 160
             }
161 161
 
162
-            if (!$_child instanceof NodeInterface) {
162
+            if (!$_child instanceof NodeInterface){
163 163
                 continue;
164 164
             }
165 165
 
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
             $traverseChildren = true;
169 169
             $breakVisitorID = null;
170 170
 
171
-            foreach ($this->visitors as $visitorID => $visitor) {
171
+            foreach ($this->visitors as $visitorID => $visitor){
172 172
                 $result = $visitor->enterNode($_child, $ctx);
173
-                switch (true) {
173
+                switch (true){
174 174
                     case $result === null:
175 175
                         break;
176 176
 
@@ -193,22 +193,22 @@  discard block
 block discarded – undo
193 193
 
194 194
                     default:
195 195
                         throw new \LogicException(
196
-                            'enterNode() returned invalid value of type ' . \gettype($result)
196
+                            'enterNode() returned invalid value of type '.\gettype($result)
197 197
                         );
198 198
                 }
199 199
             }
200 200
 
201
-            if ($traverseChildren) {
201
+            if ($traverseChildren){
202 202
                 $_child = $this->traverseNode($_child, $ctx);
203
-                if ($this->stopTraversal) {
203
+                if ($this->stopTraversal){
204 204
                     break;
205 205
                 }
206 206
             }
207 207
 
208
-            foreach ($this->visitors as $visitorID => $visitor) {
208
+            foreach ($this->visitors as $visitorID => $visitor){
209 209
                 $result = $visitor->leaveNode($_child, $ctx);
210 210
 
211
-                switch (true) {
211
+                switch (true){
212 212
                     case $result === null:
213 213
                         break;
214 214
 
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 
223 223
                     default:
224 224
                         throw new \LogicException(
225
-                            'leaveNode() returned invalid value of type ' . \gettype($result)
225
+                            'leaveNode() returned invalid value of type '.\gettype($result)
226 226
                         );
227 227
                 }
228 228
 
229
-                if ($breakVisitorID === $visitorID) {
229
+                if ($breakVisitorID === $visitorID){
230 230
                     break;
231 231
                 }
232 232
             }
Please login to merge, or discard this patch.
src/Config/src/Patch/Prepend.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@
 block discarded – undo
19 19
         string $position,
20 20
         private readonly ?string $key,
21 21
         private mixed $value
22
-    ) {
22
+    ){
23 23
         $this->position = $position === '.' ? '' : $position;
24 24
     }
25 25
 
26 26
     public function patch(array $config): array
27 27
     {
28
-        try {
28
+        try{
29 29
             $_target = &$this->dotGet($config, $this->position);
30 30
 
31
-            if ($this->key !== null) {
31
+            if ($this->key !== null){
32 32
                 $_target = \array_merge([$this->key => $this->value], $_target);
33
-            } else {
33
+            }else{
34 34
                 \array_unshift($_target, $this->value);
35 35
             }
36
-        } catch (DotNotFoundException $e) {
36
+        }catch (DotNotFoundException $e){
37 37
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
38 38
         }
39 39
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Set.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,15 +19,15 @@
 block discarded – undo
19 19
     public function __construct(
20 20
         private string $key,
21 21
         private mixed $value
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     public function patch(array $config): array
26 26
     {
27
-        try {
27
+        try{
28 28
             $_target = &$this->dotGet($config, $this->key);
29 29
             $_target = $this->value;
30
-        } catch (DotNotFoundException $e) {
30
+        }catch (DotNotFoundException $e){
31 31
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Filters/src/Model/Schema/AttributeMapper.php 1 patch
Spacing   +17 added lines, -17 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
     /**
@@ -37,48 +37,48 @@  discard block
 block discarded – undo
37 37
         $setters = [];
38 38
         $class = new \ReflectionClass($filter);
39 39
 
40
-        foreach ($class->getProperties() as $property) {
40
+        foreach ($class->getProperties() as $property){
41 41
             /** @var object $attribute */
42
-            foreach ($this->reader->getPropertyMetadata($property) as $attribute) {
43
-                if ($attribute instanceof AbstractInput) {
42
+            foreach ($this->reader->getPropertyMetadata($property) as $attribute){
43
+                if ($attribute instanceof AbstractInput){
44 44
                     $this->setValue($filter, $property, $attribute->getValue($input, $property));
45 45
                     $schema[$property->getName()] = $attribute->getSchema($property);
46
-                } elseif ($attribute instanceof NestedFilter) {
46
+                } elseif ($attribute instanceof NestedFilter){
47 47
                     $prefix = $attribute->prefix ?? $property->name;
48
-                    try {
48
+                    try{
49 49
                         $value = $this->provider->createFilter(
50 50
                             $attribute->class,
51 51
                             $input->withPrefix($prefix)
52 52
                         );
53 53
 
54 54
                         $this->setValue($filter, $property, $value);
55
-                    } catch (ValidationException $e) {
55
+                    }catch (ValidationException $e){
56 56
                         $errors[$prefix] = $e->errors;
57 57
                     }
58 58
 
59 59
                     $schema[$property->getName()] = $attribute->getSchema($property);
60
-                } elseif ($attribute instanceof NestedArray) {
60
+                } elseif ($attribute instanceof NestedArray){
61 61
                     $values = $attribute->getValue($input, $property);
62 62
                     $propertyValues = [];
63 63
 
64 64
                     $prefix = $attribute->input->key ?? $attribute->prefix ?? $property->getName();
65 65
 
66
-                    if (\is_array($values)) {
67
-                        foreach (\array_keys($values) as $key) {
68
-                            try {
66
+                    if (\is_array($values)){
67
+                        foreach (\array_keys($values) as $key){
68
+                            try{
69 69
                                 $propertyValues[$key] = $this->provider->createFilter(
70 70
                                     $attribute->class,
71
-                                    $input->withPrefix($prefix . '.' . $key)
71
+                                    $input->withPrefix($prefix.'.'.$key)
72 72
                                 );
73
-                            } catch (ValidationException $e) {
73
+                            }catch (ValidationException $e){
74 74
                                 $errors[$property->getName()][$key] = $e->errors;
75 75
                             }
76 76
                         }
77 77
                     }
78 78
 
79 79
                     $this->setValue($filter, $property, $propertyValues);
80
-                    $schema[$property->getName()] = [$attribute->class, $prefix . '.*'];
81
-                } elseif ($attribute instanceof Setter) {
80
+                    $schema[$property->getName()] = [$attribute->class, $prefix.'.*'];
81
+                } elseif ($attribute instanceof Setter){
82 82
                     $setters[$property->getName()][] = $attribute;
83 83
                 }
84 84
             }
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 
90 90
     private function setValue(FilterInterface $filter, \ReflectionProperty $property, mixed $value): void
91 91
     {
92
-        if ($value === null) {
92
+        if ($value === null){
93 93
             return;
94 94
         }
95 95
 
96 96
         $setters = $this->reader->getPropertyMetadata($property, Setter::class);
97 97
 
98
-        foreach ($setters as $setter) {
98
+        foreach ($setters as $setter){
99 99
             $value = $setter->updateValue($value);
100 100
         }
101 101
 
Please login to merge, or discard this patch.
src/Router/src/RouteCollection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function __clone()
18 18
     {
19
-        foreach ($this->routes as $name => $route) {
19
+        foreach ($this->routes as $name => $route){
20 20
             $this->routes[$name] = clone $route;
21 21
         }
22 22
     }
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
      *
91 91
      * TODO add return type
92 92
      */
93
-    public function remove(string|array $name)
93
+    public function remove(string | array $name)
94 94
     {
95
-        foreach ((array) $name as $n) {
95
+        foreach ((array)$name as $n){
96 96
             unset($this->routes[$n]);
97 97
         }
98 98
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function addCollection(self $collection)
106 106
     {
107
-        foreach ($collection->all() as $name => $route) {
107
+        foreach ($collection->all() as $name => $route){
108 108
             $this->routes[$name] = $route;
109 109
         }
110 110
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function group(string $group)
122 122
     {
123
-        foreach ($this->routes as $route) {
123
+        foreach ($this->routes as $route){
124 124
             $route->group($group);
125 125
         }
126 126
     }
Please login to merge, or discard this patch.
src/Router/src/GroupRegistry.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function __construct(
22 22
         private readonly FactoryInterface $factory
23
-    ) {
23
+    ){
24 24
     }
25 25
 
26 26
     /**
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function getGroup(string $name): RouteGroup
30 30
     {
31
-        if (!isset($this->groups[$name])) {
31
+        if (!isset($this->groups[$name])){
32 32
             $this->groups[$name] = $this->factory->make(RouteGroup::class);
33 33
         }
34 34
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function registerRoutes(RouterInterface $router): void
62 62
     {
63
-        foreach ($this->groups as $group) {
63
+        foreach ($this->groups as $group){
64 64
             $group->register($router, $this->factory);
65 65
         }
66 66
     }
Please login to merge, or discard this patch.
src/AuthHttp/src/Transport/CookieTransport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         private readonly bool $secure = false,
23 23
         private readonly bool $httpOnly = true,
24 24
         private readonly ?string $sameSite = null
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     public function fetchToken(Request $request): ?string
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     ): Response {
40 40
         /** @var CookieQueue $cookieQueue */
41 41
         $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE);
42
-        if ($cookieQueue === null) {
42
+        if ($cookieQueue === null){
43 43
             return $response->withAddedHeader(
44 44
                 'Set-Cookie',
45 45
                 Cookie::create(
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
             );
56 56
         }
57 57
 
58
-        if ($tokenID === null) {
58
+        if ($tokenID === null){
59 59
             $cookieQueue->delete($this->cookie);
60
-        } else {
60
+        }else{
61 61
             $cookieQueue->set(
62 62
                 $this->cookie,
63 63
                 $tokenID,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     private function getLifetime(\DateTimeInterface $expiresAt = null): ?int
86 86
     {
87
-        if ($expiresAt === null) {
87
+        if ($expiresAt === null){
88 88
             return null;
89 89
         }
90 90
 
Please login to merge, or discard this patch.
src/Tokenizer/src/Listener/CachedClassesLoader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         private readonly ClassLocatorByTarget $locator,
18 18
         private readonly ListenerInvoker $invoker,
19 19
         private readonly bool $readCache = true,
20
-    ) {
20
+    ){
21 21
     }
22 22
 
23 23
     public function loadClasses(TokenizationListenerInterface $listener): bool
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $targets = \iterator_to_array($this->parseAttributes($listener));
26 26
 
27 27
         // If there are no targets, then listener can't be cached.
28
-        if ($targets === []) {
28
+        if ($targets === []){
29 29
             return false;
30 30
         }
31 31
 
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
         // We decided to load classes for each target separately.
35 35
         // It allows us to cache classes for each target separately and if we reuse the
36 36
         // same target in multiple listeners, we will not have to load classes for the same target.
37
-        foreach ($targets as $target) {
37
+        foreach ($targets as $target){
38 38
             $cacheKey = (string)$target;
39 39
 
40 40
             $classes = $this->readCache ? $this->memory->loadData($cacheKey) : null;
41
-            if ($classes === null) {
41
+            if ($classes === null){
42 42
                 $this->memory->saveData(
43 43
                     $cacheKey,
44 44
                     $classes = $this->locator->getClasses($target),
Please login to merge, or discard this patch.