Test Failed
Pull Request — master (#1045)
by
unknown
12:32 queued 06:03
created
src/Core/tests/InjectableTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     public function testInvalidInjector(): void
41 41
     {
42
-        $excepted = "Class 'Spiral\Tests\Core\Fixtures\InvalidInjector' must be an " .
42
+        $excepted = "Class 'Spiral\Tests\Core\Fixtures\InvalidInjector' must be an ".
43 43
                     "instance of InjectorInterface for 'Spiral\Tests\Core\Fixtures\TestConfig'";
44 44
         $this->expectException(InjectionException::class);
45 45
         $this->expectExceptionMessage($excepted);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function testInvalidRuntimeInjector(): void
67 67
     {
68
-        $excepted = "Class 'Spiral\Tests\Core\Fixtures\InvalidInjector' must be an " .
68
+        $excepted = "Class 'Spiral\Tests\Core\Fixtures\InvalidInjector' must be an ".
69 69
             "instance of InjectorInterface for 'Spiral\Tests\Core\Fixtures\TestConfig'";
70 70
         $this->expectException(InjectionException::class);
71 71
         $this->expectExceptionMessage($excepted);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $container->bind(ConfigsInterface::class, $configurator);
103 103
 
104 104
         $configurator->shouldReceive('createInjection')
105
-            ->with(m::on(static function (ReflectionClass $r) {
105
+            ->with(m::on(static function (ReflectionClass $r){
106 106
                 return $r->getName() === TestConfig::class;
107 107
             }), null)
108 108
             ->andReturn($expected);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $container->bind(ConfigsInterface::class, $configurator);
120 120
 
121 121
         $configurator->shouldReceive('createInjection')
122
-            ->with(m::on(static function (ReflectionClass $r) {
122
+            ->with(m::on(static function (ReflectionClass $r){
123 123
                 return $r->getName() === TestConfig::class;
124 124
             }), 'context')
125 125
             ->andReturn($expected);
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
     public function testExtendedInjectorAnonClassObjectParam(): void
208 208
     {
209 209
         $container = new Container();
210
-        $container->bind(stdClass::class, new Injectable(new class implements Container\InjectorInterface {
211
-            public function createInjection(\ReflectionClass $class, object|string|null $context = null): object
210
+        $container->bind(stdClass::class, new Injectable(new class implements Container\InjectorInterface{
211
+            public function createInjection(\ReflectionClass $class, object | string | null $context = null): object
212 212
             {
213 213
                 return (object)['context' => $context];
214 214
             }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     public function testExtendedInjectorAnonClassMixedParam(): void
224 224
     {
225 225
         $container = new Container();
226
-        $container->bind(stdClass::class, new Injectable(new class implements Container\InjectorInterface {
226
+        $container->bind(stdClass::class, new Injectable(new class implements Container\InjectorInterface{
227 227
             public function createInjection(\ReflectionClass $class, mixed $context = null): object
228 228
             {
229 229
                 return (object)['context' => $context];
Please login to merge, or discard this patch.
src/Core/tests/Fixtures/ExtendedContextInjector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  */
13 13
 class ExtendedContextInjector implements InjectorInterface
14 14
 {
15
-    public function createInjection(\ReflectionClass $class, \ReflectionParameter|string|null $context = null): object
15
+    public function createInjection(\ReflectionClass $class, \ReflectionParameter | string | null $context = null): object
16 16
     {
17 17
         return (object)['context' => $context];
18 18
     }
Please login to merge, or discard this patch.
src/Core/src/Internal/Container.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     use DestructorTrait;
20 20
 
21 21
     private State $state;
22
-    private FactoryInterface|Factory $factory;
22
+    private FactoryInterface | Factory $factory;
23 23
 
24 24
     public function __construct(Registry $constructor)
25 25
     {
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
      * @throws ContainerException
48 48
      * @throws \Throwable
49 49
      */
50
-    public function get(string|Autowire $id, \Stringable|string|null $context = null): mixed
50
+    public function get(string | Autowire $id, \Stringable | string | null $context = null): mixed
51 51
     {
52
-        if ($id instanceof Autowire) {
52
+        if ($id instanceof Autowire){
53 53
             return $id->resolve($this->factory);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Core/src/Internal/Factory.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -66,19 +66,19 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @throws \Throwable
68 68
      */
69
-    public function make(string $alias, array $parameters = [], Stringable|string|null $context = null): mixed
69
+    public function make(string $alias, array $parameters = [], Stringable | string | null $context = null): mixed
70 70
     {
71
-        if ($parameters === [] && \array_key_exists($alias, $this->state->singletons)) {
71
+        if ($parameters === [] && \array_key_exists($alias, $this->state->singletons)){
72 72
             return $this->state->singletons[$alias];
73 73
         }
74 74
 
75 75
         $binding = $this->state->bindings[$alias] ?? null;
76 76
 
77
-        if ($binding === null) {
77
+        if ($binding === null){
78 78
             return $this->resolveWithoutBinding($alias, $parameters, $context);
79 79
         }
80 80
 
81
-        try {
81
+        try{
82 82
             $this->tracer->push(
83 83
                 false,
84 84
                 action: 'resolve from binding',
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                     ->resolveWeakReference($binding, $alias, $context, $parameters),
107 107
                 default => $binding,
108 108
             };
109
-        } finally {
109
+        }finally{
110 110
             $this->state->bindings[$alias] ??= $binding;
111 111
             $this->tracer->pop(true);
112 112
             $this->tracer->pop(false);
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
     private function resolveInjector(Injectable $binding, Ctx $ctx, array $arguments)
117 117
     {
118 118
         $context = $ctx->context;
119
-        try {
119
+        try{
120 120
             $reflection = $ctx->reflection ??= new \ReflectionClass($ctx->class);
121
-        } catch (\ReflectionException $e) {
121
+        }catch (\ReflectionException $e){
122 122
             throw new ContainerException($e->getMessage(), $e->getCode(), $e);
123 123
         }
124 124
 
125 125
         $injector = $binding->injector;
126 126
 
127
-        try {
127
+        try{
128 128
             $injectorInstance = \is_object($injector) ? $injector : $this->container->get($injector);
129 129
 
130
-            if (!$injectorInstance instanceof InjectorInterface) {
130
+            if (!$injectorInstance instanceof InjectorInterface){
131 131
                 throw new InjectionException(
132 132
                     \sprintf(
133 133
                         "Class '%s' must be an instance of InjectorInterface for '%s'.",
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 default => (string)$context,
156 156
             });
157 157
 
158
-            if (!$reflection->isInstance($instance)) {
158
+            if (!$reflection->isInstance($instance)){
159 159
                 throw new InjectionException(
160 160
                     \sprintf(
161 161
                         "Invalid injection response for '%s'.",
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             }
166 166
 
167 167
             return $instance;
168
-        } finally {
168
+        }finally{
169 169
             $this->state->bindings[$reflection->getName()] ??= $binding;
170 170
         }
171 171
     }
@@ -173,18 +173,18 @@  discard block
 block discarded – undo
173 173
     private function resolveAlias(
174 174
         \Spiral\Core\Config\Alias $binding,
175 175
         string $alias,
176
-        Stringable|string|null $context,
176
+        Stringable | string | null $context,
177 177
         array $arguments,
178 178
     ): mixed {
179 179
         $result = $binding->alias === $alias
180 180
             ? $this->autowire(
181
-                new Ctx(alias: $alias, class: $binding->alias, context: $context, singleton: $binding->singleton),
181
+                new Ctx(alias : $alias, class : $binding->alias, context : $context, singleton : $binding->singleton),
182 182
                 $arguments,
183 183
             )
184 184
             //Binding is pointing to something else
185 185
             : $this->make($binding->alias, $arguments, $context);
186 186
 
187
-        if ($binding->singleton && $arguments === []) {
187
+        if ($binding->singleton && $arguments === []){
188 188
             $this->state->singletons[$alias] = $result;
189 189
         }
190 190
 
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
     private function resolveShared(
195 195
         \Spiral\Core\Config\Shared $binding,
196 196
         string $alias,
197
-        Stringable|string|null $context,
197
+        Stringable | string | null $context,
198 198
         array $arguments,
199 199
     ): object {
200 200
         $avoidCache = $arguments !== [];
201 201
         return $avoidCache
202 202
             ? $this->createInstance(
203
-                new Ctx(alias: $alias, class: $binding->value::class, context: $context),
203
+                new Ctx(alias : $alias, class : $binding->value::class, context : $context),
204 204
                 $arguments,
205 205
             )
206 206
             : $binding->value;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     private function resolveAutowire(
210 210
         \Spiral\Core\Config\Autowire $binding,
211 211
         string $alias,
212
-        Stringable|string|null $context,
212
+        Stringable | string | null $context,
213 213
         array $arguments,
214 214
     ): mixed {
215 215
         $instance = $binding->autowire->resolve($this, $arguments);
@@ -219,17 +219,17 @@  discard block
 block discarded – undo
219 219
     }
220 220
 
221 221
     private function resolveFactory(
222
-        \Spiral\Core\Config\Factory|DeferredFactory $binding,
222
+        \Spiral\Core\Config\Factory | DeferredFactory $binding,
223 223
         string $alias,
224
-        Stringable|string|null $context,
224
+        Stringable | string | null $context,
225 225
         array $arguments,
226 226
     ): mixed {
227 227
         $ctx = new Ctx(alias: $alias, class: $alias, context: $context, singleton: $binding->singleton);
228
-        try {
228
+        try{
229 229
             $instance = $binding::class === \Spiral\Core\Config\Factory::class && $binding->getParametersCount() === 0
230 230
                 ? ($binding->factory)()
231 231
                 : $this->invoker->invoke($binding->factory, $arguments);
232
-        } catch (NotCallableException $e) {
232
+        }catch (NotCallableException $e){
233 233
             throw new ContainerException(
234 234
                 $this->tracer->combineTraceMessage(\sprintf('Invalid binding for `%s`.', $ctx->alias)),
235 235
                 $e->getCode(),
@@ -243,24 +243,24 @@  discard block
 block discarded – undo
243 243
     private function resolveWeakReference(
244 244
         \Spiral\Core\Config\WeakReference $binding,
245 245
         string $alias,
246
-        Stringable|string|null $context,
246
+        Stringable | string | null $context,
247 247
         array $arguments,
248 248
     ): ?object {
249 249
         $avoidCache = $arguments !== [];
250 250
 
251
-        if (($avoidCache || $binding->reference->get() === null) && \class_exists($alias)) {
252
-            try {
251
+        if (($avoidCache || $binding->reference->get() === null) && \class_exists($alias)){
252
+            try{
253 253
                 $this->tracer->push(false, alias: $alias, source: WeakReference::class, context: $context);
254 254
 
255 255
                 $object = $this->createInstance(
256 256
                     new Ctx(alias: $alias, class: $alias, context: $context),
257 257
                     $arguments,
258 258
                 );
259
-                if ($avoidCache) {
259
+                if ($avoidCache){
260 260
                     return $object;
261 261
                 }
262 262
                 $binding->reference = WeakReference::create($object);
263
-            } catch (\Throwable) {
263
+            }catch (\Throwable){
264 264
                 throw new ContainerException(
265 265
                     $this->tracer->combineTraceMessage(
266 266
                         \sprintf(
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                         )
271 271
                     )
272 272
                 );
273
-            } finally {
273
+            }finally{
274 274
                 $this->tracer->pop();
275 275
             }
276 276
         }
@@ -281,22 +281,22 @@  discard block
 block discarded – undo
281 281
     private function resolveWithoutBinding(
282 282
         string $alias,
283 283
         array $parameters = [],
284
-        Stringable|string|null $context = null
284
+        Stringable | string | null $context = null
285 285
     ): mixed {
286 286
         $parent = $this->scope->getParent();
287 287
 
288
-        if ($parent !== null) {
289
-            try {
288
+        if ($parent !== null){
289
+            try{
290 290
                 $this->tracer->push(false, ...[
291 291
                     'current scope' => $this->scope->getScopeName(),
292 292
                     'jump to parent scope' => $this->scope->getParentScope()->getScopeName(),
293 293
                 ]);
294 294
                 return $parent->make($alias, $parameters, $context);
295
-            } catch (BadScopeException $e) {
296
-                if ($this->scope->getScopeName() !== $e->getScope()) {
295
+            }catch (BadScopeException $e){
296
+                if ($this->scope->getScopeName() !== $e->getScope()){
297 297
                     throw $e;
298 298
                 }
299
-            } catch (ContainerExceptionInterface $e) {
299
+            }catch (ContainerExceptionInterface $e){
300 300
                 $className = match (true) {
301 301
                     $e instanceof NotFoundException => NotFoundException::class,
302 302
                     default => ContainerException::class,
@@ -305,19 +305,19 @@  discard block
 block discarded – undo
305 305
                     'Can\'t resolve `%s`.',
306 306
                     $alias,
307 307
                 )), previous: $e);
308
-            } finally {
308
+            }finally{
309 309
                 $this->tracer->pop(false);
310 310
             }
311 311
         }
312 312
 
313 313
         $this->tracer->push(false, action: 'autowire', alias: $alias, context: $context);
314
-        try {
314
+        try{
315 315
             //No direct instructions how to construct class, make is automatically
316 316
             return $this->autowire(
317 317
                 new Ctx(alias: $alias, class: $alias, context: $context),
318 318
                 $parameters,
319 319
             );
320
-        } finally {
320
+        }finally{
321 321
             $this->tracer->pop(false);
322 322
         }
323 323
     }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
                 &&
339 339
                 (isset($this->state->injectors[$ctx->class]) || $this->binder->hasInjector($ctx->class))
340 340
         ))
341
-        ) {
341
+        ){
342 342
             throw new NotFoundException($this->tracer->combineTraceMessage(\sprintf(
343 343
                 'Can\'t resolve `%s`: undefined class or binding `%s`.',
344 344
                 $this->tracer->getRootAlias(),
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         // Check scope name
368 368
         $ctx->reflection = new \ReflectionClass($instance);
369 369
         $scopeName = ($ctx->reflection->getAttributes(ScopeAttribute::class)[0] ?? null)?->newInstance()->name;
370
-        if ($scopeName !== null && $scopeName !== $this->scope->getScopeName()) {
370
+        if ($scopeName !== null && $scopeName !== $this->scope->getScopeName()){
371 371
             throw new BadScopeException($scopeName, $instance::class);
372 372
         }
373 373
 
@@ -394,24 +394,24 @@  discard block
 block discarded – undo
394 394
         array $parameters,
395 395
     ): object {
396 396
         $class = $ctx->class;
397
-        try {
397
+        try{
398 398
             $ctx->reflection = $reflection = new \ReflectionClass($class);
399
-        } catch (\ReflectionException $e) {
399
+        }catch (\ReflectionException $e){
400 400
             throw new ContainerException($e->getMessage(), $e->getCode(), $e);
401 401
         }
402 402
 
403 403
         // Check scope name
404 404
         $scope = ($reflection->getAttributes(ScopeAttribute::class)[0] ?? null)?->newInstance()->name;
405
-        if ($scope !== null && $scope !== $this->scope->getScopeName()) {
405
+        if ($scope !== null && $scope !== $this->scope->getScopeName()){
406 406
             throw new BadScopeException($scope, $class);
407 407
         }
408 408
 
409 409
         //We have to construct class using external injector when we know exact context
410
-        if ($this->binder->hasInjector($class)) {
410
+        if ($this->binder->hasInjector($class)){
411 411
             return $this->resolveInjector($this->state->bindings[$ctx->class], $ctx, $parameters);
412 412
         }
413 413
 
414
-        if (!$reflection->isInstantiable()) {
414
+        if (!$reflection->isInstantiable()){
415 415
             $itIs = match (true) {
416 416
                 $reflection->isEnum() => 'Enum',
417 417
                 $reflection->isAbstract() => 'Abstract class',
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
 
425 425
         $constructor = $reflection->getConstructor();
426 426
 
427
-        if ($constructor !== null) {
428
-            try {
427
+        if ($constructor !== null){
428
+            try{
429 429
                 $this->tracer->push(false, action: 'resolve arguments', signature: $constructor);
430 430
                 $this->tracer->push(true);
431 431
                 $arguments = $this->resolver->resolveArguments($constructor, $parameters);
432
-            } catch (ValidationException $e) {
432
+            }catch (ValidationException $e){
433 433
                 throw new ContainerException(
434 434
                     $this->tracer->combineTraceMessage(
435 435
                         \sprintf(
@@ -439,22 +439,22 @@  discard block
 block discarded – undo
439 439
                         )
440 440
                     ),
441 441
                 );
442
-            } finally {
442
+            }finally{
443 443
                 $this->tracer->pop(true);
444 444
                 $this->tracer->pop(false);
445 445
             }
446
-            try {
446
+            try{
447 447
                 // Using constructor with resolved arguments
448 448
                 $this->tracer->push(false, call: "$class::__construct", arguments: $arguments);
449 449
                 $this->tracer->push(true);
450 450
                 $instance = new $class(...$arguments);
451
-            } catch (\TypeError $e) {
451
+            }catch (\TypeError $e){
452 452
                 throw new WrongTypeException($constructor, $e);
453
-            } finally {
453
+            }finally{
454 454
                 $this->tracer->pop(true);
455 455
                 $this->tracer->pop(false);
456 456
             }
457
-        } else {
457
+        }else{
458 458
             // No constructor specified
459 459
             $instance = $reflection->newInstance();
460 460
         }
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
         $instance = $this->runInflector($instance);
473 473
 
474 474
         //Declarative singletons
475
-        if ($this->isSingleton($ctx)) {
475
+        if ($this->isSingleton($ctx)){
476 476
             $this->state->singletons[$ctx->alias] = $instance;
477 477
         }
478 478
 
479 479
         // Register finalizer
480 480
         $finalizer = $this->getFinalizer($ctx, $instance);
481
-        if ($finalizer !== null) {
481
+        if ($finalizer !== null){
482 482
             $this->state->finalizers[] = $finalizer;
483 483
         }
484 484
 
@@ -490,12 +490,12 @@  discard block
 block discarded – undo
490 490
      */
491 491
     private function isSingleton(Ctx $ctx): bool
492 492
     {
493
-        if ($ctx->singleton === true) {
493
+        if ($ctx->singleton === true){
494 494
             return true;
495 495
         }
496 496
 
497 497
         /** @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/9489 */
498
-        if ($ctx->reflection->implementsInterface(SingletonInterface::class)) {
498
+        if ($ctx->reflection->implementsInterface(SingletonInterface::class)){
499 499
             return true;
500 500
         }
501 501
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
          * @var Finalize|null $attribute
510 510
          */
511 511
         $attribute = ($ctx->reflection->getAttributes(Finalize::class)[0] ?? null)?->newInstance();
512
-        if ($attribute === null) {
512
+        if ($attribute === null){
513 513
             return null;
514 514
         }
515 515
 
@@ -523,10 +523,10 @@  discard block
 block discarded – undo
523 523
     {
524 524
         $scope = $this->scope;
525 525
 
526
-        while ($scope !== null) {
527
-            foreach ($this->state->inflectors as $class => $inflectors) {
528
-                if ($instance instanceof $class) {
529
-                    foreach ($inflectors as $inflector) {
526
+        while ($scope !== null){
527
+            foreach ($this->state->inflectors as $class => $inflectors){
528
+                if ($instance instanceof $class){
529
+                    foreach ($inflectors as $inflector){
530 530
                         $instance = $inflector->getParametersCount() > 1
531 531
                             ? $this->invoker->invoke($inflector->inflector, [$instance])
532 532
                             : ($inflector->inflector)($instance);
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 
543 543
     private function validateArguments(ContextFunction $reflection, array $arguments = []): bool
544 544
     {
545
-        try {
545
+        try{
546 546
             $this->resolver->validateArguments($reflection, $arguments);
547
-        } catch (\Throwable) {
547
+        }catch (\Throwable){
548 548
             return false;
549 549
         }
550 550
 
Please login to merge, or discard this patch.
src/Core/src/Internal/Factory/Ctx.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@
 block discarded – undo
17 17
     public function __construct(
18 18
         public readonly string $alias,
19 19
         public string $class,
20
-        public \Stringable|string|null $context = null,
20
+        public \Stringable | string | null $context = null,
21 21
         public ?bool $singleton = null,
22 22
         public ?\ReflectionClass $reflection = null,
23
-    ) {
23
+    ){
24 24
     }
25 25
 }
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/ProxyClassRendererTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,24 +34,24 @@  discard block
 block discarded – undo
34 34
         yield [$from(fn(string $string = self::STRING_CONST) => 0), 'string $string = self::STRING_CONST'];
35 35
         yield [
36 36
             $from(fn(string $string = ProxyClassRendererTest::STRING_CONST) => 0),
37
-            'string $string = \\' . self::class . '::STRING_CONST',
37
+            'string $string = \\'.self::class.'::STRING_CONST',
38 38
         ];
39
-        yield [$from(fn(string|int $string = self::INT_CONST) => 0), 'string|int $string = self::INT_CONST'];
39
+        yield [$from(fn(string | int $string = self::INT_CONST) => 0), 'string|int $string = self::INT_CONST'];
40 40
         yield [$from(fn(mixed $string = 42) => 0), 'mixed $string = 42'];
41 41
         yield [$from(fn(int $string = 42) => 0), 'int $string = 42'];
42 42
         yield [$from(fn(float $string = 42) => 0), 'float $string = 42.0'];
43 43
         yield [$from(fn(?bool $string = false) => 0), '?bool $string = false'];
44
-        yield [$from(fn(bool|null $string = true) => 0), '?bool $string = true'];
44
+        yield [$from(fn(bool | null $string = true) => 0), '?bool $string = true'];
45 45
         yield [$from(fn(object $string = null) => 0), '?object $string = NULL'];
46 46
         yield [$from(fn(iterable $string = null) => 0), '?iterable $string = NULL'];
47 47
         yield [$from(fn(Countable&ArrayAccess $val) => 0), '\Countable&\ArrayAccess $val'];
48 48
         yield [$from(fn(string ...$val) => 0), 'string ...$val'];
49
-        yield [$from(fn(string|int ...$val) => 0), 'string|int ...$val'];
50
-        yield [$from(fn(string|int &$link) => 0), 'string|int &$link'];
49
+        yield [$from(fn(string | int ...$val) => 0), 'string|int ...$val'];
50
+        yield [$from(fn(string | int &$link) => 0), 'string|int &$link'];
51 51
         yield [$from(self::withSelf(...)), \sprintf('\%s $self = new self()', self::class)];
52 52
         yield [$from(fn(object $link = new \stdClass()) => 0), 'object $link = new \stdClass()'];
53 53
         yield [
54
-            $from(fn(#[Proxy] float|int|\stdClass|null $string = new \stdClass(1, 2, bar: "\n'zero")) => 0),
54
+            $from(fn(#[Proxy] float | int | \stdClass | null $string = new \stdClass(1, 2, bar: "\n'zero")) => 0),
55 55
             "\stdClass|int|float|null \$string = new \stdClass(1, 2, bar: '\n\'zero')",
56 56
         ];
57 57
         yield [
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
             public const INT_CONST = 42;
77 77
 
78 78
             #[ExpectedAttribute('public function test1(...$variadic)')]
79
-            public function test1(...$variadic) {}
79
+            public function test1(...$variadic){}
80 80
             #[ExpectedAttribute('public function test2(string|int $string = self::INT_CONST): string|int')]
81
-            public function test2(string|int $string = self::INT_CONST): string|int {}
81
+            public function test2(string | int $string = self::INT_CONST): string | int {}
82 82
             #[ExpectedAttribute('public function test3(object $obj = new \stdClass(new \stdClass(), new \stdClass()))')]
83
-            public function test3(object $obj = new stdClass(new stdClass(), new stdClass())) {}
84
-            #[ExpectedAttribute('public function test4(): \\' . ProxyClassRendererTest::class)]
83
+            public function test3(object $obj = new stdClass(new stdClass(), new stdClass())){}
84
+            #[ExpectedAttribute('public function test4(): \\'.ProxyClassRendererTest::class)]
85 85
             public function test4(): ProxyClassRendererTest {}
86 86
             #[ExpectedAttribute('public function &test5(): string')]
87 87
             public function &test5(): string {}
88 88
         };
89 89
 
90
-        foreach ((new \ReflectionClass($class))->getMethods() as $method) {
90
+        foreach ((new \ReflectionClass($class))->getMethods() as $method){
91 91
             $expected = $method->getAttributes(ExpectedAttribute::class)[0]->newInstance();
92 92
 
93 93
             yield [$method, $expected->value];
@@ -117,6 +117,6 @@  discard block
 block discarded – undo
117 117
 {
118 118
     public function __construct(
119 119
         public readonly string $value,
120
-    ) {
120
+    ){
121 121
     }
122 122
 }
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/ProxyTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
             $proxy = $$var;
72 72
             self::assertSame(['foo', 'bar', 'baz', 69], $proxy->extraVariadic('foo', 'bar', 'baz', 69));
73 73
             self::assertSame(
74
-                ['foo' => 'foo','zap' => 'bar', 'gas' => 69],
74
+                ['foo' => 'foo', 'zap' => 'bar', 'gas' => 69],
75 75
                 $proxy->extraVariadic(foo: 'foo', zap: 'bar', gas: 69),
76 76
             );
77 77
         });
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/Stub/MockInterfaceImpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         return $name;
16 16
     }
17 17
 
18
-    public function qux(int|string $age = 42): string|int
18
+    public function qux(int | string $age = 42): string | int
19 19
     {
20 20
         return $age;
21 21
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function concat(string $prefix, string &$byLink): array
39 39
     {
40
-        $byLink = $prefix . $byLink;
40
+        $byLink = $prefix.$byLink;
41 41
         return \func_get_args();
42 42
     }
43 43
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function concatMultiple(string $prefix, string &...$byLink): array
50 50
     {
51
-        foreach ($byLink as $k => $link) {
52
-            $byLink[$k] = $prefix . $link;
51
+        foreach ($byLink as $k => $link){
52
+            $byLink[$k] = $prefix.$link;
53 53
             unset($link);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/Stub/MockInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function baz(string $name, int $age): string;
14 14
 
15
-    public function qux(string|int $age = 42): string|int;
15
+    public function qux(string | int $age = 42): string | int;
16 16
 
17 17
     public function space(mixed $test age = 42): mixed;
18 18
 
Please login to merge, or discard this patch.