Passed
Pull Request — master (#1205)
by Aleksei
15:01 queued 03:15
created
src/Telemetry/src/Monolog/TelemetryProcessor.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,20 +13,20 @@
 block discarded – undo
13 13
 {
14 14
     public function __construct(
15 15
         private readonly ContainerInterface $container,
16
-    ) {}
16
+    ){}
17 17
 
18 18
     /**
19 19
      * @psalm-suppress InvalidReturnType
20 20
      * @psalm-suppress InvalidReturnStatement
21 21
      */
22
-    public function __invoke(LogRecord|array $record): array|LogRecord
22
+    public function __invoke(LogRecord | array $record): array | LogRecord
23 23
     {
24 24
         $tracer = $this->container->get(TracerInterface::class);
25 25
         \assert($tracer instanceof TracerInterface);
26 26
 
27 27
         $context = $tracer->getContext();
28 28
 
29
-        if (!empty($context)) {
29
+        if (!empty($context)){
30 30
             $record['extra']['telemetry'] = $context;
31 31
         }
32 32
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function __construct(
15 15
         private readonly ContainerInterface $container,
16
-    ) {}
16
+    ) {
17
+}
17 18
 
18 19
     /**
19 20
      * @psalm-suppress InvalidReturnType
@@ -26,7 +27,8 @@  discard block
 block discarded – undo
26 27
 
27 28
         $context = $tracer->getContext();
28 29
 
29
-        if (!empty($context)) {
30
+        if (!empty($context))
31
+        {
30 32
             $record['extra']['telemetry'] = $context;
31 33
         }
32 34
 
Please login to merge, or discard this patch.
src/Telemetry/tests/Monolog/TelemetryProcessorTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             ],
73 73
         ];
74 74
 
75
-        if (!\class_exists(LogRecord::class)) {
75
+        if (!\class_exists(LogRecord::class)){
76 76
             return;
77 77
         }
78 78
 
@@ -127,6 +127,6 @@  discard block
 block discarded – undo
127 127
 
128 128
         $record = $processor->__invoke($record);
129 129
 
130
-        self::assertSame($expected, (array) $record);
130
+        self::assertSame($expected, (array)$record);
131 131
     }
132 132
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,8 @@
 block discarded – undo
72 72
             ],
73 73
         ];
74 74
 
75
-        if (!\class_exists(LogRecord::class)) {
75
+        if (!\class_exists(LogRecord::class))
76
+        {
76 77
             return;
77 78
         }
78 79
 
Please login to merge, or discard this patch.
src/Cache/src/CacheRepository.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         protected CacheInterface $storage,
26 26
         protected ?EventDispatcherInterface $dispatcher = null,
27 27
         protected ?string $prefix = null,
28
-    ) {}
28
+    ){}
29 29
 
30 30
     public function get(string $key, mixed $default = null): mixed
31 31
     {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         $value = $this->storage->get($key);
37 37
 
38
-        if ($value === null) {
38
+        if ($value === null){
39 39
             $this->dispatcher?->dispatch(new CacheMissed($key));
40 40
 
41 41
             return $default;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         return $value;
47 47
     }
48 48
 
49
-    public function set(string $key, mixed $value, \DateInterval|int|null $ttl = null): bool
49
+    public function set(string $key, mixed $value, \DateInterval | int | null $ttl = null): bool
50 50
     {
51 51
         $key = $this->resolveKey($key);
52 52
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $array = [];
91 91
         // Resolve keys and dispatch events
92
-        foreach ($keys as $key) {
92
+        foreach ($keys as $key){
93 93
             $key = $this->resolveKey($key);
94 94
             $this->dispatcher?->dispatch(new CacheRetrieving($key));
95 95
             // Fill resulting array with default values
@@ -99,16 +99,16 @@  discard block
 block discarded – undo
99 99
         // If no dispatcher is set, we can skip the loop with events
100 100
         // to save some CPU cycles
101 101
         $keys = \array_keys($array);
102
-        if ($this->dispatcher === null) {
102
+        if ($this->dispatcher === null){
103 103
             return $this->storage->getMultiple($keys, $default);
104 104
         }
105 105
 
106 106
         $result = $this->storage->getMultiple($keys);
107 107
 
108
-        foreach ($result as $key => $value) {
109
-            if ($value === null) {
108
+        foreach ($result as $key => $value){
109
+            if ($value === null){
110 110
                 $this->dispatcher->dispatch(new CacheMissed($key));
111
-            } else {
111
+            }else{
112 112
                 // Replace default value with actual value in the resulting array
113 113
                 $array[$key] = $value;
114 114
                 $this->dispatcher->dispatch(new CacheHit($key, $value));
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
         return $array;
119 119
     }
120 120
 
121
-    public function setMultiple(iterable $values, \DateInterval|int|null $ttl = null): bool
121
+    public function setMultiple(iterable $values, \DateInterval | int | null $ttl = null): bool
122 122
     {
123 123
         $dispatcher = $this->dispatcher;
124 124
         $array = [];
125 125
         // Resolve keys and dispatch events
126
-        foreach ($values as $key => $value) {
126
+        foreach ($values as $key => $value){
127 127
             $key = $this->resolveKey($key);
128 128
             $dispatcher?->dispatch(new KeyWriting($key, $value));
129 129
             $array[$key] = $value;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
         $array = [];
150 150
         // Resolve keys and dispatch events
151
-        foreach ($keys as $key) {
151
+        foreach ($keys as $key){
152 152
             $key = $this->resolveKey($key);
153 153
             $dispatcher?->dispatch(new KeyDeleting($key));
154 154
             $array[] = $key;
@@ -179,6 +179,6 @@  discard block
 block discarded – undo
179 179
 
180 180
     private function resolveKey(string $key): string
181 181
     {
182
-        return $this->prefix . $key;
182
+        return $this->prefix.$key;
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
         protected CacheInterface $storage,
26 26
         protected ?EventDispatcherInterface $dispatcher = null,
27 27
         protected ?string $prefix = null,
28
-    ) {}
28
+    ) {
29
+}
29 30
 
30 31
     public function get(string $key, mixed $default = null): mixed
31 32
     {
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
 
36 37
         $value = $this->storage->get($key);
37 38
 
38
-        if ($value === null) {
39
+        if ($value === null)
40
+        {
39 41
             $this->dispatcher?->dispatch(new CacheMissed($key));
40 42
 
41 43
             return $default;
@@ -89,7 +91,8 @@  discard block
 block discarded – undo
89 91
     {
90 92
         $array = [];
91 93
         // Resolve keys and dispatch events
92
-        foreach ($keys as $key) {
94
+        foreach ($keys as $key)
95
+        {
93 96
             $key = $this->resolveKey($key);
94 97
             $this->dispatcher?->dispatch(new CacheRetrieving($key));
95 98
             // Fill resulting array with default values
@@ -99,16 +102,21 @@  discard block
 block discarded – undo
99 102
         // If no dispatcher is set, we can skip the loop with events
100 103
         // to save some CPU cycles
101 104
         $keys = \array_keys($array);
102
-        if ($this->dispatcher === null) {
105
+        if ($this->dispatcher === null)
106
+        {
103 107
             return $this->storage->getMultiple($keys, $default);
104 108
         }
105 109
 
106 110
         $result = $this->storage->getMultiple($keys);
107 111
 
108
-        foreach ($result as $key => $value) {
109
-            if ($value === null) {
112
+        foreach ($result as $key => $value)
113
+        {
114
+            if ($value === null)
115
+            {
110 116
                 $this->dispatcher->dispatch(new CacheMissed($key));
111
-            } else {
117
+            }
118
+            else
119
+            {
112 120
                 // Replace default value with actual value in the resulting array
113 121
                 $array[$key] = $value;
114 122
                 $this->dispatcher->dispatch(new CacheHit($key, $value));
@@ -123,7 +131,8 @@  discard block
 block discarded – undo
123 131
         $dispatcher = $this->dispatcher;
124 132
         $array = [];
125 133
         // Resolve keys and dispatch events
126
-        foreach ($values as $key => $value) {
134
+        foreach ($values as $key => $value)
135
+        {
127 136
             $key = $this->resolveKey($key);
128 137
             $dispatcher?->dispatch(new KeyWriting($key, $value));
129 138
             $array[$key] = $value;
@@ -148,7 +157,8 @@  discard block
 block discarded – undo
148 157
 
149 158
         $array = [];
150 159
         // Resolve keys and dispatch events
151
-        foreach ($keys as $key) {
160
+        foreach ($keys as $key)
161
+        {
152 162
             $key = $this->resolveKey($key);
153 163
             $dispatcher?->dispatch(new KeyDeleting($key));
154 164
             $array[] = $key;
Please login to merge, or discard this patch.
src/Stempler/src/Lexer/Grammar/Dynamic/DirectiveGrammar.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -39,39 +39,39 @@  discard block
 block discarded – undo
39 39
         $this->body = null;
40 40
         $hasWhitespace = false;
41 41
 
42
-        while ($n = $src->next()) {
43
-            if (!$n instanceof Byte) {
42
+        while ($n = $src->next()){
43
+            if (!$n instanceof Byte){
44 44
                 // no other grammars are allowed
45 45
                 break;
46 46
             }
47 47
 
48
-            switch ($n->char) {
48
+            switch ($n->char){
49 49
                 case '(':
50 50
                     $this->flushName();
51 51
                     $this->tokens[] = new Token(DynamicGrammar::TYPE_BODY_OPEN, $n->offset, $n->char);
52 52
 
53 53
                     return $this->parseBody($src);
54 54
                 default:
55
-                    if (\preg_match(self::REGEXP_WHITESPACE, $n->char)) {
55
+                    if (\preg_match(self::REGEXP_WHITESPACE, $n->char)){
56 56
                         $hasWhitespace = true;
57
-                        if ($this->name !== []) {
57
+                        if ($this->name !== []){
58 58
                             $this->flushName();
59 59
                             $this->tokens[] = new Token(DynamicGrammar::TYPE_WHITESPACE, $n->offset, $n->char);
60 60
                             break;
61 61
                         }
62 62
 
63
-                        if ($this->getLastToken()->type === DynamicGrammar::TYPE_WHITESPACE) {
63
+                        if ($this->getLastToken()->type === DynamicGrammar::TYPE_WHITESPACE){
64 64
                             $this->getLastToken()->content .= $n->char;
65 65
                             break;
66 66
                         }
67 67
 
68 68
                         // invalid directive
69 69
                         return false;
70
-                    } elseif ($hasWhitespace) {
70
+                    } elseif ($hasWhitespace){
71 71
                         return $this->finalize();
72 72
                     }
73 73
 
74
-                    if (!\preg_match(self::REGEXP_KEYWORD, $n->char)) {
74
+                    if (!\preg_match(self::REGEXP_KEYWORD, $n->char)){
75 75
                         $this->flushName();
76 76
 
77 77
                         return $this->finalize();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function getIterator(): \Generator
95 95
     {
96
-        if ($this->tokens === []) {
96
+        if ($this->tokens === []){
97 97
             throw new \LogicException('Directive not parsed');
98 98
         }
99 99
 
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getKeyword(): string
115 115
     {
116
-        foreach ($this->tokens as $token) {
117
-            if ($token->type === DynamicGrammar::TYPE_KEYWORD) {
116
+        foreach ($this->tokens as $token){
117
+            if ($token->type === DynamicGrammar::TYPE_KEYWORD){
118 118
                 return $token->content;
119 119
             }
120 120
         }
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function getBody(): ?string
129 129
     {
130
-        foreach ($this->tokens as $token) {
131
-            if ($token->type === DynamicGrammar::TYPE_BODY) {
130
+        foreach ($this->tokens as $token){
131
+            if ($token->type === DynamicGrammar::TYPE_BODY){
132 132
                 return $token->content;
133 133
             }
134 134
         }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private function flushName(): void
143 143
     {
144
-        if ($this->name === []) {
144
+        if ($this->name === []){
145 145
             return;
146 146
         }
147 147
 
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
         $this->body = [];
160 160
         $level = 1;
161 161
 
162
-        while ($nn = $src->next()) {
163
-            if (!$nn instanceof Byte) {
162
+        while ($nn = $src->next()){
163
+            if (!$nn instanceof Byte){
164 164
                 $this->flushBody();
165 165
                 return $this->finalize();
166 166
             }
167 167
 
168
-            if (\in_array($nn->char, ['"', '"'])) {
168
+            if (\in_array($nn->char, ['"', '"'])){
169 169
                 $this->body[] = $nn;
170
-                while ($nnn = $src->next()) {
170
+                while ($nnn = $src->next()){
171 171
                     $this->body[] = $nnn;
172
-                    if ($nnn instanceof Byte && $nnn->char === $nn->char) {
172
+                    if ($nnn instanceof Byte && $nnn->char === $nn->char){
173 173
                         break;
174 174
                     }
175 175
                 }
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 
179 179
             $this->body[] = $nn;
180 180
 
181
-            if ($nn->char === '(') {
181
+            if ($nn->char === '('){
182 182
                 $level++;
183 183
                 continue;
184 184
             }
185 185
 
186
-            if ($nn->char === ')') {
186
+            if ($nn->char === ')'){
187 187
                 $level--;
188 188
 
189
-                if ($level === 0) {
189
+                if ($level === 0){
190 190
                     $n = \array_pop($this->body);
191 191
 
192 192
                     $this->flushBody();
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     private function flushBody(): void
207 207
     {
208
-        if ($this->body === []) {
208
+        if ($this->body === []){
209 209
             return;
210 210
         }
211 211
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
     private function getLastToken(): Token
217 217
     {
218
-        if ($this->tokens === []) {
218
+        if ($this->tokens === []){
219 219
             throw new \LogicException('Directive not parsed');
220 220
         }
221 221
 
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 
232 232
         // A directive must have at least one keyword
233 233
         // Without it, it's just a char
234
-        if (\count($tokens) === 1 && $tokens[0]->content === self::DIRECTIVE_CHAR) {
234
+        if (\count($tokens) === 1 && $tokens[0]->content === self::DIRECTIVE_CHAR){
235 235
             return false;
236 236
         }
237 237
 
238
-        foreach (\array_reverse($tokens, true) as $i => $t) {
239
-            if ($t->type !== DynamicGrammar::TYPE_WHITESPACE) {
238
+        foreach (\array_reverse($tokens, true) as $i => $t){
239
+            if ($t->type !== DynamicGrammar::TYPE_WHITESPACE){
240 240
                 break;
241 241
             }
242 242
 
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
         }
245 245
 
246 246
         $body = null;
247
-        foreach ($tokens as $t) {
248
-            if ($t->type === DynamicGrammar::TYPE_BODY_OPEN) {
247
+        foreach ($tokens as $t){
248
+            if ($t->type === DynamicGrammar::TYPE_BODY_OPEN){
249 249
                 $body = false;
250 250
                 continue;
251 251
             }
252 252
 
253
-            if ($t->type === DynamicGrammar::TYPE_BODY_CLOSE) {
253
+            if ($t->type === DynamicGrammar::TYPE_BODY_CLOSE){
254 254
                 $body = null;
255 255
             }
256 256
         }
257 257
 
258
-        if ($body !== null) {
258
+        if ($body !== null){
259 259
             return false;
260 260
         }
261 261
 
Please login to merge, or discard this patch.
Braces   +63 added lines, -31 removed lines patch added patch discarded remove patch
@@ -39,39 +39,48 @@  discard block
 block discarded – undo
39 39
         $this->body = null;
40 40
         $hasWhitespace = false;
41 41
 
42
-        while ($n = $src->next()) {
43
-            if (!$n instanceof Byte) {
42
+        while ($n = $src->next())
43
+        {
44
+            if (!$n instanceof Byte)
45
+            {
44 46
                 // no other grammars are allowed
45 47
                 break;
46 48
             }
47 49
 
48
-            switch ($n->char) {
50
+            switch ($n->char)
51
+            {
49 52
                 case '(':
50 53
                     $this->flushName();
51 54
                     $this->tokens[] = new Token(DynamicGrammar::TYPE_BODY_OPEN, $n->offset, $n->char);
52 55
 
53 56
                     return $this->parseBody($src);
54 57
                 default:
55
-                    if (\preg_match(self::REGEXP_WHITESPACE, $n->char)) {
58
+                    if (\preg_match(self::REGEXP_WHITESPACE, $n->char))
59
+                    {
56 60
                         $hasWhitespace = true;
57
-                        if ($this->name !== []) {
61
+                        if ($this->name !== [])
62
+                        {
58 63
                             $this->flushName();
59 64
                             $this->tokens[] = new Token(DynamicGrammar::TYPE_WHITESPACE, $n->offset, $n->char);
60 65
                             break;
61 66
                         }
62 67
 
63
-                        if ($this->getLastToken()->type === DynamicGrammar::TYPE_WHITESPACE) {
68
+                        if ($this->getLastToken()->type === DynamicGrammar::TYPE_WHITESPACE)
69
+                        {
64 70
                             $this->getLastToken()->content .= $n->char;
65 71
                             break;
66 72
                         }
67 73
 
68 74
                         // invalid directive
69 75
                         return false;
70
-                    } elseif ($hasWhitespace) {
76
+                    }
77
+                    elseif ($hasWhitespace)
78
+                    {
71 79
                         return $this->finalize();
72 80
                     }
73 81
 
74
-                    if (!\preg_match(self::REGEXP_KEYWORD, $n->char)) {
82
+                    if (!\preg_match(self::REGEXP_KEYWORD, $n->char))
83
+                    {
75 84
                         $this->flushName();
76 85
 
77 86
                         return $this->finalize();
@@ -93,7 +102,8 @@  discard block
 block discarded – undo
93 102
      */
94 103
     public function getIterator(): \Generator
95 104
     {
96
-        if ($this->tokens === []) {
105
+        if ($this->tokens === [])
106
+        {
97 107
             throw new \LogicException('Directive not parsed');
98 108
         }
99 109
 
@@ -113,8 +123,10 @@  discard block
 block discarded – undo
113 123
      */
114 124
     public function getKeyword(): string
115 125
     {
116
-        foreach ($this->tokens as $token) {
117
-            if ($token->type === DynamicGrammar::TYPE_KEYWORD) {
126
+        foreach ($this->tokens as $token)
127
+        {
128
+            if ($token->type === DynamicGrammar::TYPE_KEYWORD)
129
+            {
118 130
                 return $token->content;
119 131
             }
120 132
         }
@@ -127,8 +139,10 @@  discard block
 block discarded – undo
127 139
      */
128 140
     public function getBody(): ?string
129 141
     {
130
-        foreach ($this->tokens as $token) {
131
-            if ($token->type === DynamicGrammar::TYPE_BODY) {
142
+        foreach ($this->tokens as $token)
143
+        {
144
+            if ($token->type === DynamicGrammar::TYPE_BODY)
145
+            {
132 146
                 return $token->content;
133 147
             }
134 148
         }
@@ -141,7 +155,8 @@  discard block
 block discarded – undo
141 155
      */
142 156
     private function flushName(): void
143 157
     {
144
-        if ($this->name === []) {
158
+        if ($this->name === [])
159
+        {
145 160
             return;
146 161
         }
147 162
 
@@ -159,17 +174,22 @@  discard block
 block discarded – undo
159 174
         $this->body = [];
160 175
         $level = 1;
161 176
 
162
-        while ($nn = $src->next()) {
163
-            if (!$nn instanceof Byte) {
177
+        while ($nn = $src->next())
178
+        {
179
+            if (!$nn instanceof Byte)
180
+            {
164 181
                 $this->flushBody();
165 182
                 return $this->finalize();
166 183
             }
167 184
 
168
-            if (\in_array($nn->char, ['"', '"'])) {
185
+            if (\in_array($nn->char, ['"', '"']))
186
+            {
169 187
                 $this->body[] = $nn;
170
-                while ($nnn = $src->next()) {
188
+                while ($nnn = $src->next())
189
+                {
171 190
                     $this->body[] = $nnn;
172
-                    if ($nnn instanceof Byte && $nnn->char === $nn->char) {
191
+                    if ($nnn instanceof Byte && $nnn->char === $nn->char)
192
+                    {
173 193
                         break;
174 194
                     }
175 195
                 }
@@ -178,15 +198,18 @@  discard block
 block discarded – undo
178 198
 
179 199
             $this->body[] = $nn;
180 200
 
181
-            if ($nn->char === '(') {
201
+            if ($nn->char === '(')
202
+            {
182 203
                 $level++;
183 204
                 continue;
184 205
             }
185 206
 
186
-            if ($nn->char === ')') {
207
+            if ($nn->char === ')')
208
+            {
187 209
                 $level--;
188 210
 
189
-                if ($level === 0) {
211
+                if ($level === 0)
212
+                {
190 213
                     $n = \array_pop($this->body);
191 214
 
192 215
                     $this->flushBody();
@@ -205,7 +228,8 @@  discard block
 block discarded – undo
205 228
      */
206 229
     private function flushBody(): void
207 230
     {
208
-        if ($this->body === []) {
231
+        if ($this->body === [])
232
+        {
209 233
             return;
210 234
         }
211 235
 
@@ -215,7 +239,8 @@  discard block
 block discarded – undo
215 239
 
216 240
     private function getLastToken(): Token
217 241
     {
218
-        if ($this->tokens === []) {
242
+        if ($this->tokens === [])
243
+        {
219 244
             throw new \LogicException('Directive not parsed');
220 245
         }
221 246
 
@@ -231,12 +256,15 @@  discard block
 block discarded – undo
231 256
 
232 257
         // A directive must have at least one keyword
233 258
         // Without it, it's just a char
234
-        if (\count($tokens) === 1 && $tokens[0]->content === self::DIRECTIVE_CHAR) {
259
+        if (\count($tokens) === 1 && $tokens[0]->content === self::DIRECTIVE_CHAR)
260
+        {
235 261
             return false;
236 262
         }
237 263
 
238
-        foreach (\array_reverse($tokens, true) as $i => $t) {
239
-            if ($t->type !== DynamicGrammar::TYPE_WHITESPACE) {
264
+        foreach (\array_reverse($tokens, true) as $i => $t)
265
+        {
266
+            if ($t->type !== DynamicGrammar::TYPE_WHITESPACE)
267
+            {
240 268
                 break;
241 269
             }
242 270
 
@@ -244,18 +272,22 @@  discard block
 block discarded – undo
244 272
         }
245 273
 
246 274
         $body = null;
247
-        foreach ($tokens as $t) {
248
-            if ($t->type === DynamicGrammar::TYPE_BODY_OPEN) {
275
+        foreach ($tokens as $t)
276
+        {
277
+            if ($t->type === DynamicGrammar::TYPE_BODY_OPEN)
278
+            {
249 279
                 $body = false;
250 280
                 continue;
251 281
             }
252 282
 
253
-            if ($t->type === DynamicGrammar::TYPE_BODY_CLOSE) {
283
+            if ($t->type === DynamicGrammar::TYPE_BODY_CLOSE)
284
+            {
254 285
                 $body = null;
255 286
             }
256 287
         }
257 288
 
258
-        if ($body !== null) {
289
+        if ($body !== null)
290
+        {
259 291
             return false;
260 292
         }
261 293
 
Please login to merge, or discard this patch.
src/Core/src/Config/Shared.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
     public function __construct(
13 13
         public readonly object $value,
14 14
         public readonly bool $singleton = false,
15
-    ) {}
15
+    ){}
16 16
 
17 17
     public function __toString(): string
18 18
     {
19
-        return 'Shared object of class ' . $this->value::class;
19
+        return 'Shared object of class '.$this->value::class;
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
     public function __construct(
13 13
         public readonly object $value,
14 14
         public readonly bool $singleton = false,
15
-    ) {}
15
+    ) {
16
+}
16 17
 
17 18
     public function __toString(): string
18 19
     {
Please login to merge, or discard this patch.
rector.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -30,62 +30,62 @@  discard block
 block discarded – undo
30 30
 
31 31
 return RectorConfig::configure()
32 32
     ->withPaths([
33
-        __DIR__ . '/src/*/src',
34
-        __DIR__ . '/src/*/*/src',
35
-        __DIR__ . '/src/*/*/tests',
36
-        __DIR__ . '/src/*/tests',
37
-        __DIR__ . '/tests',
33
+        __DIR__.'/src/*/src',
34
+        __DIR__.'/src/*/*/src',
35
+        __DIR__.'/src/*/*/tests',
36
+        __DIR__.'/src/*/tests',
37
+        __DIR__.'/tests',
38 38
     ])
39 39
     ->withParallel()
40 40
     ->withSkip([
41 41
         IfIssetToCoalescingRector::class,
42 42
         RemoveUnusedPrivatePropertyRector::class => [
43
-            __DIR__ . '/src/Scaffolder/src/Command/BootloaderCommand.php',
44
-            __DIR__ . '/src/Scaffolder/src/Command/CommandCommand.php',
45
-            __DIR__ . '/src/Scaffolder/src/Command/ConfigCommand.php',
46
-            __DIR__ . '/src/Scaffolder/src/Command/ControllerCommand.php',
47
-            __DIR__ . '/src/Scaffolder/src/Command/FilterCommand.php',
48
-            __DIR__ . '/src/Scaffolder/src/Command/JobHandlerCommand.php',
49
-            __DIR__ . '/src/Scaffolder/src/Command/MiddlewareCommand.php',
50
-            __DIR__ . '/src/Console/tests/PromptArgumentsTest.php',
43
+            __DIR__.'/src/Scaffolder/src/Command/BootloaderCommand.php',
44
+            __DIR__.'/src/Scaffolder/src/Command/CommandCommand.php',
45
+            __DIR__.'/src/Scaffolder/src/Command/ConfigCommand.php',
46
+            __DIR__.'/src/Scaffolder/src/Command/ControllerCommand.php',
47
+            __DIR__.'/src/Scaffolder/src/Command/FilterCommand.php',
48
+            __DIR__.'/src/Scaffolder/src/Command/JobHandlerCommand.php',
49
+            __DIR__.'/src/Scaffolder/src/Command/MiddlewareCommand.php',
50
+            __DIR__.'/src/Console/tests/PromptArgumentsTest.php',
51 51
         ],
52 52
         RemoveUnusedPrivateMethodRector::class => [
53
-            __DIR__ . '/src/Boot/src/Bootloader/ConfigurationBootloader.php',
54
-            __DIR__ . '/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php',
55
-            __DIR__ . '/src/Cache/src/Bootloader/CacheBootloader.php',
56
-            __DIR__ . '/src/Serializer/src/Bootloader/SerializerBootloader.php',
57
-            __DIR__ . '/src/Validation/src/Bootloader/ValidationBootloader.php',
58
-            __DIR__ . '/src/Translator/tests/IndexerTest.php',
59
-            __DIR__ . '/src/Tokenizer/tests/ReflectionFileTest.php',
60
-            __DIR__ . '/src/Core/tests/SingletonsTest.php',
53
+            __DIR__.'/src/Boot/src/Bootloader/ConfigurationBootloader.php',
54
+            __DIR__.'/src/Broadcasting/src/Bootloader/BroadcastingBootloader.php',
55
+            __DIR__.'/src/Cache/src/Bootloader/CacheBootloader.php',
56
+            __DIR__.'/src/Serializer/src/Bootloader/SerializerBootloader.php',
57
+            __DIR__.'/src/Validation/src/Bootloader/ValidationBootloader.php',
58
+            __DIR__.'/src/Translator/tests/IndexerTest.php',
59
+            __DIR__.'/src/Tokenizer/tests/ReflectionFileTest.php',
60
+            __DIR__.'/src/Core/tests/SingletonsTest.php',
61 61
         ],
62 62
         RemoveUselessVarTagRector::class => [
63
-            __DIR__ . '/src/Console/src/Traits/HelpersTrait.php',
63
+            __DIR__.'/src/Console/src/Traits/HelpersTrait.php',
64 64
         ],
65 65
         RemoveAlwaysTrueIfConditionRector::class => [
66
-            __DIR__ . '/src/Boot/src/BootloadManager/Initializer.php',
67
-            __DIR__ . '/src/Stempler/src/Traverser.php',
68
-            __DIR__ . '/src/Prototype/src/NodeVisitors/LocateProperties.php',
69
-            __DIR__ . '/src/Prototype/src/NodeVisitors/RemoveTrait.php',
70
-            __DIR__ . '/src/Logger/src/ListenerRegistry.php',
71
-            __DIR__ . '/src/Stempler/src/Transform/Merge/ExtendsParent.php',
72
-            __DIR__ . '/src/Bridge/Stempler/src/StemplerEngine.php',
66
+            __DIR__.'/src/Boot/src/BootloadManager/Initializer.php',
67
+            __DIR__.'/src/Stempler/src/Traverser.php',
68
+            __DIR__.'/src/Prototype/src/NodeVisitors/LocateProperties.php',
69
+            __DIR__.'/src/Prototype/src/NodeVisitors/RemoveTrait.php',
70
+            __DIR__.'/src/Logger/src/ListenerRegistry.php',
71
+            __DIR__.'/src/Stempler/src/Transform/Merge/ExtendsParent.php',
72
+            __DIR__.'/src/Bridge/Stempler/src/StemplerEngine.php',
73 73
         ],
74 74
         RemoveExtraParametersRector::class => [
75
-            __DIR__ . '/src/Boot/src/BootloadManager/AbstractBootloadManager.php',
75
+            __DIR__.'/src/Boot/src/BootloadManager/AbstractBootloadManager.php',
76 76
         ],
77 77
         RemoveUnusedPrivateMethodParameterRector::class => [
78
-            __DIR__ . '/src/Core/src/Internal/Factory.php',
79
-            __DIR__ . '/src/Core/tests/InjectableTest.php',
78
+            __DIR__.'/src/Core/src/Internal/Factory.php',
79
+            __DIR__.'/src/Core/tests/InjectableTest.php',
80 80
         ],
81 81
         RemoveDoubleAssignRector::class => [
82
-            __DIR__ . '/src/Core/tests/Scope/FinalizeAttributeTest.php',
82
+            __DIR__.'/src/Core/tests/Scope/FinalizeAttributeTest.php',
83 83
         ],
84 84
         RemoveUnusedVariableAssignRector::class => [
85
-            __DIR__ . '/src/Core/tests/ExceptionsTest.php',
85
+            __DIR__.'/src/Core/tests/ExceptionsTest.php',
86 86
         ],
87 87
         RemoveDeadStmtRector::class => [
88
-            __DIR__ . '/src/Core/tests/ExceptionsTest.php',
88
+            __DIR__.'/src/Core/tests/ExceptionsTest.php',
89 89
         ],
90 90
 
91 91
         // to be enabled later for bc break 4.x
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
         NewInInitializerRector::class,
96 96
 
97 97
         // start with short open tag
98
-        __DIR__ . '/src/Views/tests/fixtures/other/var.php',
99
-        __DIR__ . '/tests/app/views/native.php',
98
+        __DIR__.'/src/Views/tests/fixtures/other/var.php',
99
+        __DIR__.'/tests/app/views/native.php',
100 100
 
101 101
         // example code for test
102 102
         '*/Fixture/*',
@@ -106,24 +106,24 @@  discard block
 block discarded – undo
106 106
         '*/Stubs/*',
107 107
         '*/tests/Classes/*',
108 108
         '*/tests/Internal/*',
109
-        __DIR__ . '/src/Console/tests/Configurator',
109
+        __DIR__.'/src/Console/tests/Configurator',
110 110
 
111 111
         // cache
112 112
         '*/runtime/cache/*',
113 113
 
114 114
         ReadOnlyPropertyRector::class => [
115 115
             // used by Configurator
116
-            __DIR__ . '/src/Scaffolder/src/Command',
116
+            __DIR__.'/src/Scaffolder/src/Command',
117 117
         ],
118 118
 
119 119
         FirstClassCallableRector::class => [
120
-            __DIR__ . '/src/Core/tests/Scope/UseCaseTest.php',
120
+            __DIR__.'/src/Core/tests/Scope/UseCaseTest.php',
121 121
         ],
122 122
 
123 123
         PreferPHPUnitThisCallRector::class,
124 124
 
125 125
         MakeInheritedMethodVisibilitySameAsParentRector::class => [
126
-            __DIR__ . '/src/Models/tests/PublicEntity.php',
126
+            __DIR__.'/src/Models/tests/PublicEntity.php',
127 127
         ],
128 128
     ])
129 129
     ->withPhpSets(php81: true)
Please login to merge, or discard this patch.
src/Pagination/tests/LimitsTraitTest.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@
 block discarded – undo
21 21
 
22 22
     protected function setUp(): void
23 23
     {
24
-        $this->trait = new class {
24
+        $this->trait = new class
25
+        {
25 26
             use LimitsTrait;
26 27
         };
27 28
     }
Please login to merge, or discard this patch.
src/Scaffolder/tests/BaseTestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     protected function setUp(): void
22 22
     {
23 23
         $this->app = TestApp::create([
24
-            'root' => __DIR__ . '/App',
24
+            'root' => __DIR__.'/App',
25 25
         ], false)->run();
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
src/Security/tests/Traits/GuardedTraitTest.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
 
29 29
     protected function setUp(): void
30 30
     {
31
-        $this->trait = new class {
31
+        $this->trait = new class
32
+        {
32 33
             use GuardedTrait;
33 34
         };
34 35
         $this->guard = $this->createMock(GuardInterface::class);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
         self::assertSame(static::OPERATION, $guarded->resolvePermission(static::OPERATION));
77 77
 
78 78
         $guarded = new GuardedWithNamespace();
79
-        $resolvedPermission = GuardedWithNamespace::GUARD_NAMESPACE . '.' . static::OPERATION;
79
+        $resolvedPermission = GuardedWithNamespace::GUARD_NAMESPACE.'.'.static::OPERATION;
80 80
         self::assertSame($resolvedPermission, $guarded->resolvePermission(static::OPERATION));
81 81
     }
82 82
 
Please login to merge, or discard this patch.