Passed
Push — master ( 37709b...f45e89 )
by Aleksei
06:22 queued 17s
created
src/Framework/Bootloader/Http/SessionBootloader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 {
27 27
     public function __construct(
28 28
         private readonly BinderInterface $binder,
29
-    ) {
29
+    ){
30 30
     }
31 31
 
32 32
     public function defineBindings(): array
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 SessionInterface::class,
38 38
                 new Proxy(SessionInterface::class, false, $this->resolveSession(...)),
39 39
             );
40
-        $this->binder->bind(SessionInterface::class, new Proxy(SessionInterface::class, true), );
40
+        $this->binder->bind(SessionInterface::class, new Proxy(SessionInterface::class, true),);
41 41
 
42 42
         return [];
43 43
     }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 'handler' => new Autowire(
72 72
                     FileHandler::class,
73 73
                     [
74
-                        'directory' => $directories->get('runtime') . 'session',
74
+                        'directory' => $directories->get('runtime').'session',
75 75
                         'lifetime' => 86400,
76 76
                     ]
77 77
                 ),
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 
91 91
     private function resolveSession(ContainerInterface $container): SessionInterface
92 92
     {
93
-        try {
93
+        try{
94 94
             /** @var ServerRequestInterface $request */
95 95
             $request = $container->get(ServerRequestInterface::class);
96 96
             return $request->getAttribute(SessionMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException(
97 97
                 SessionInterface::class,
98 98
                 SessionMiddleware::ATTRIBUTE,
99 99
             );
100
-        } catch (InvalidRequestScopeException $e) {
100
+        }catch (InvalidRequestScopeException $e){
101 101
             throw new InvalidRequestScopeException(SessionInterface::class, previous: $e);
102 102
         }
103 103
     }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/Exception/InvalidRequestScopeException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
 {
20 20
     public function __construct(
21 21
         string $id,
22
-        string|Container|null $scopeOrContainer = null,
23
-        \Throwable|null $previous = null,
24
-    ) {
22
+        string | Container | null $scopeOrContainer = null,
23
+        \Throwable | null $previous = null,
24
+    ){
25 25
         parent::__construct($id, $scopeOrContainer, Spiral::HttpRequest->value, $previous);
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/CookiesBootloader.php 1 patch
Spacing   +3 added lines, -3 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 ConfiguratorInterface $config,
24 24
         private readonly BinderInterface $binder,
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     public function defineBindings(): array
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
     private function cookieQueue(ServerRequestInterface $request): CookieQueue
56 56
     {
57
-        try {
57
+        try{
58 58
             return $request->getAttribute(CookieQueue::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException(
59 59
                 CookieQueue::class,
60 60
                 CookieQueue::ATTRIBUTE,
61 61
             );
62
-        } catch (InvalidRequestScopeException $e) {
62
+        }catch (InvalidRequestScopeException $e){
63 63
             throw new InvalidRequestScopeException(CookieQueue::class, previous: $e);
64 64
         }
65 65
     }
Please login to merge, or discard this patch.
src/Core/src/Exception/Shared/InvalidContainerScopeException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
     protected string $scope;
17 17
     public function __construct(
18 18
         protected readonly string $id,
19
-        Container|string|null $scopeOrContainer = null,
19
+        Container | string | null $scopeOrContainer = null,
20 20
         protected readonly ?string $requiredScope = null,
21
-        \Throwable|null $previous = null,
22
-    ) {
21
+        \Throwable | null $previous = null,
22
+    ){
23 23
         $this->scope = \is_string($scopeOrContainer)
24 24
             ? $scopeOrContainer
25 25
             : Introspector::scopeName($scopeOrContainer);
Please login to merge, or discard this patch.
src/Core/src/Exception/Container/RecursiveProxyException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         public readonly string $alias,
15 15
         public readonly ?string $bindingScope = null,
16
-        public readonly ?array $callingScope = null,
17
-    ) {
16
+        public readonly ? array $callingScope = null,
17
+    ){
18 18
         $message = "Recursive proxy detected for `$alias`.";
19 19
         $bindingScope === null or $message .= "\nBinding scope: `$bindingScope`.";
20
-        $callingScope === null or $message .= "\nCalling scope: `" . \implode('.', $callingScope) . '`.';
20
+        $callingScope === null or $message .= "\nCalling scope: `".\implode('.', $callingScope).'`.';
21 21
         parent::__construct($message);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
src/Core/src/Config/Proxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
     public function __construct(
18 18
         protected readonly string $interface,
19 19
         public readonly bool $singleton = false,
20
-        public readonly ?\Closure $fallbackFactory = null,
21
-    ) {
20
+        public readonly ? \Closure $fallbackFactory = null,
21
+    ){
22 22
         \interface_exists($interface) or throw new \InvalidArgumentException(
23 23
             "Interface `{$interface}` does not exist.",
24 24
         );
Please login to merge, or discard this patch.
src/Core/src/Internal/Factory.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
      *
69 69
      * @throws \Throwable
70 70
      */
71
-    public function make(string $alias, array $parameters = [], Stringable|string|null $context = null): mixed
71
+    public function make(string $alias, array $parameters = [], Stringable | string | null $context = null): mixed
72 72
     {
73
-        if ($parameters === [] && \array_key_exists($alias, $this->state->singletons)) {
73
+        if ($parameters === [] && \array_key_exists($alias, $this->state->singletons)){
74 74
             return $this->state->singletons[$alias];
75 75
         }
76 76
 
77 77
         $binding = $this->state->bindings[$alias] ?? null;
78 78
 
79
-        if ($binding === null) {
79
+        if ($binding === null){
80 80
             return $this->resolveWithoutBinding($alias, $parameters, $context);
81 81
         }
82 82
 
83
-        try {
83
+        try{
84 84
             $this->tracer->push(
85 85
                 false,
86 86
                 action: 'resolve from binding',
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                     ->resolveWeakReference($binding, $alias, $context, $parameters),
111 111
                 default => $binding,
112 112
             };
113
-        } finally {
113
+        }finally{
114 114
             $this->state->bindings[$alias] ??= $binding;
115 115
             $this->tracer->pop(true);
116 116
             $this->tracer->pop(false);
@@ -124,18 +124,18 @@  discard block
 block discarded – undo
124 124
     private function resolveInjector(Config\Injectable $binding, Ctx $ctx, array $arguments)
125 125
     {
126 126
         $context = $ctx->context;
127
-        try {
127
+        try{
128 128
             $reflection = $ctx->reflection ??= new \ReflectionClass($ctx->class);
129
-        } catch (\ReflectionException $e) {
129
+        }catch (\ReflectionException $e){
130 130
             throw new ContainerException($e->getMessage(), $e->getCode(), $e);
131 131
         }
132 132
 
133 133
         $injector = $binding->injector;
134 134
 
135
-        try {
135
+        try{
136 136
             $injectorInstance = \is_object($injector) ? $injector : $this->container->get($injector);
137 137
 
138
-            if (!$injectorInstance instanceof InjectorInterface) {
138
+            if (!$injectorInstance instanceof InjectorInterface){
139 139
                 throw new InjectionException(
140 140
                     \sprintf(
141 141
                         "Class '%s' must be an instance of InjectorInterface for '%s'.",
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 default => (string)$context,
163 163
             });
164 164
 
165
-            if (!$reflection->isInstance($instance)) {
165
+            if (!$reflection->isInstance($instance)){
166 166
                 throw new InjectionException(
167 167
                     \sprintf(
168 168
                         "Invalid injection response for '%s'.",
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             }
173 173
 
174 174
             return $instance;
175
-        } finally {
175
+        }finally{
176 176
             $this->state->bindings[$ctx->class] ??= $binding;
177 177
         }
178 178
     }
@@ -180,27 +180,27 @@  discard block
 block discarded – undo
180 180
     private function resolveAlias(
181 181
         Config\Alias $binding,
182 182
         string $alias,
183
-        Stringable|string|null $context,
183
+        Stringable | string | null $context,
184 184
         array $arguments,
185 185
     ): mixed {
186 186
         $result = $binding->alias === $alias
187 187
             ? $this->autowire(
188
-                new Ctx(alias: $alias, class: $binding->alias, context: $context, singleton: $binding->singleton),
188
+                new Ctx(alias : $alias, class : $binding->alias, context : $context, singleton : $binding->singleton),
189 189
                 $arguments,
190 190
             )
191 191
             //Binding is pointing to something else
192 192
             : $this->make($binding->alias, $arguments, $context);
193 193
 
194
-        if ($binding->singleton && $arguments === []) {
194
+        if ($binding->singleton && $arguments === []){
195 195
             $this->state->singletons[$alias] = $result;
196 196
         }
197 197
 
198 198
         return $result;
199 199
     }
200 200
 
201
-    private function resolveProxy(Config\Proxy $binding, string $alias, Stringable|string|null $context): mixed
201
+    private function resolveProxy(Config\Proxy $binding, string $alias, Stringable | string | null $context): mixed
202 202
     {
203
-        if ($context instanceof RetryContext) {
203
+        if ($context instanceof RetryContext){
204 204
             return $binding->fallbackFactory === null
205 205
                 ? throw new RecursiveProxyException(
206 206
                     $alias,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         $result = Proxy::create(new \ReflectionClass($binding->getInterface()), $context, new Attribute\Proxy());
213 213
 
214
-        if ($binding->singleton) {
214
+        if ($binding->singleton){
215 215
             $this->state->singletons[$alias] = $result;
216 216
         }
217 217
 
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
     private function resolveShared(
222 222
         Config\Shared $binding,
223 223
         string $alias,
224
-        Stringable|string|null $context,
224
+        Stringable | string | null $context,
225 225
         array $arguments,
226 226
     ): object {
227 227
         $avoidCache = $arguments !== [];
228 228
         return $avoidCache
229 229
             ? $this->createInstance(
230
-                new Ctx(alias: $alias, class: $binding->value::class, context: $context),
230
+                new Ctx(alias : $alias, class : $binding->value::class, context : $context),
231 231
                 $arguments,
232 232
             )
233 233
             : $binding->value;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     private function resolveAutowire(
237 237
         Config\Autowire $binding,
238 238
         string $alias,
239
-        Stringable|string|null $context,
239
+        Stringable | string | null $context,
240 240
         array $arguments,
241 241
     ): mixed {
242 242
         $instance = $binding->autowire->resolve($this, $arguments);
@@ -246,17 +246,17 @@  discard block
 block discarded – undo
246 246
     }
247 247
 
248 248
     private function resolveFactory(
249
-        Config\Factory|Config\DeferredFactory $binding,
249
+        Config\Factory | Config\DeferredFactory $binding,
250 250
         string $alias,
251
-        Stringable|string|null $context,
251
+        Stringable | string | null $context,
252 252
         array $arguments,
253 253
     ): mixed {
254 254
         $ctx = new Ctx(alias: $alias, class: $alias, context: $context, singleton: $binding->singleton);
255
-        try {
255
+        try{
256 256
             $instance = $binding::class === Config\Factory::class && $binding->getParametersCount() === 0
257 257
                 ? ($binding->factory)()
258 258
                 : $this->invoker->invoke($binding->factory, $arguments);
259
-        } catch (NotCallableException $e) {
259
+        }catch (NotCallableException $e){
260 260
             throw new ContainerException(
261 261
                 $this->tracer->combineTraceMessage(\sprintf('Invalid binding for `%s`.', $ctx->alias)),
262 262
                 $e->getCode(),
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
     private function resolveWeakReference(
271 271
         Config\WeakReference $binding,
272 272
         string $alias,
273
-        Stringable|string|null $context,
273
+        Stringable | string | null $context,
274 274
         array $arguments,
275 275
     ): ?object {
276 276
         $avoidCache = $arguments !== [];
277 277
 
278
-        if (($avoidCache || $binding->reference->get() === null) && \class_exists($alias)) {
279
-            try {
278
+        if (($avoidCache || $binding->reference->get() === null) && \class_exists($alias)){
279
+            try{
280 280
                 $this->tracer->push(false, alias: $alias, source: WeakReference::class, context: $context);
281 281
 
282 282
                 $object = $this->createInstance(
283 283
                     new Ctx(alias: $alias, class: $alias, context: $context),
284 284
                     $arguments,
285 285
                 );
286
-                if ($avoidCache) {
286
+                if ($avoidCache){
287 287
                     return $object;
288 288
                 }
289 289
                 $binding->reference = WeakReference::create($object);
290
-            } catch (\Throwable) {
290
+            }catch (\Throwable){
291 291
                 throw new ContainerException(
292 292
                     $this->tracer->combineTraceMessage(
293 293
                         \sprintf(
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                         )
298 298
                     )
299 299
                 );
300
-            } finally {
300
+            }finally{
301 301
                 $this->tracer->pop();
302 302
             }
303 303
         }
@@ -308,23 +308,23 @@  discard block
 block discarded – undo
308 308
     private function resolveWithoutBinding(
309 309
         string $alias,
310 310
         array $parameters = [],
311
-        Stringable|string|null $context = null
311
+        Stringable | string | null $context = null
312 312
     ): mixed {
313 313
         $parent = $this->scope->getParentFactory();
314 314
 
315
-        if ($parent !== null) {
316
-            try {
315
+        if ($parent !== null){
316
+            try{
317 317
                 $this->tracer->push(false, ...[
318 318
                     'current scope' => $this->scope->getScopeName(),
319 319
                     'jump to parent scope' => $this->scope->getParentScope()->getScopeName(),
320 320
                 ]);
321 321
                 /** @psalm-suppress TooManyArguments */
322 322
                 return $parent->make($alias, $parameters, $context);
323
-            } catch (BadScopeException $e) {
324
-                if ($this->scope->getScopeName() !== $e->getScope()) {
323
+            }catch (BadScopeException $e){
324
+                if ($this->scope->getScopeName() !== $e->getScope()){
325 325
                     throw $e;
326 326
                 }
327
-            } catch (ContainerExceptionInterface $e) {
327
+            }catch (ContainerExceptionInterface $e){
328 328
                 $className = match (true) {
329 329
                     $e instanceof NotFoundException => NotFoundException::class,
330 330
                     $e instanceof RecursiveProxyException => throw $e,
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
                     'Can\'t resolve `%s`.',
335 335
                     $alias,
336 336
                 )), previous: $e);
337
-            } finally {
337
+            }finally{
338 338
                 $this->tracer->pop(false);
339 339
             }
340 340
         }
341 341
 
342 342
         $this->tracer->push(false, action: 'autowire', alias: $alias, context: $context);
343
-        try {
343
+        try{
344 344
             //No direct instructions how to construct class, make is automatically
345 345
             return $this->autowire(
346 346
                 new Ctx(alias: $alias, class: $alias, context: $context),
347 347
                 $parameters,
348 348
             );
349
-        } finally {
349
+        }finally{
350 350
             $this->tracer->pop(false);
351 351
         }
352 352
     }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                 &&
368 368
                 (isset($this->state->injectors[$ctx->class]) || $this->binder->hasInjector($ctx->class))
369 369
         ))
370
-        ) {
370
+        ){
371 371
             throw new NotFoundException($this->tracer->combineTraceMessage(\sprintf(
372 372
                 'Can\'t resolve `%s`: undefined class or binding `%s`.',
373 373
                 $this->tracer->getRootAlias(),
@@ -393,13 +393,13 @@  discard block
 block discarded – undo
393 393
         Ctx $ctx,
394 394
         array $arguments,
395 395
     ): object {
396
-        if ($this->options->checkScope) {
396
+        if ($this->options->checkScope){
397 397
             // Check scope name
398 398
             $ctx->reflection = new \ReflectionClass($instance);
399 399
             $scopeName = ($ctx->reflection->getAttributes(Attribute\Scope::class)[0] ?? null)?->newInstance()->name;
400
-            if ($scopeName !== null) {
400
+            if ($scopeName !== null){
401 401
                 $scope = $this->scope;
402
-                while ($scope->getScopeName() !== $scopeName) {
402
+                while ($scope->getScopeName() !== $scopeName){
403 403
                     $scope = $scope->getParentScope() ?? throw new BadScopeException($scopeName, $instance::class);
404 404
                 }
405 405
             }
@@ -428,26 +428,26 @@  discard block
 block discarded – undo
428 428
         array $arguments,
429 429
     ): object {
430 430
         $class = $ctx->class;
431
-        try {
431
+        try{
432 432
             $ctx->reflection = $reflection = new \ReflectionClass($class);
433
-        } catch (\ReflectionException $e) {
433
+        }catch (\ReflectionException $e){
434 434
             throw new ContainerException($e->getMessage(), $e->getCode(), $e);
435 435
         }
436 436
 
437 437
         // Check scope name
438
-        if ($this->options->checkScope) {
438
+        if ($this->options->checkScope){
439 439
             $scope = ($reflection->getAttributes(Attribute\Scope::class)[0] ?? null)?->newInstance()->name;
440
-            if ($scope !== null && $scope !== $this->scope->getScopeName()) {
440
+            if ($scope !== null && $scope !== $this->scope->getScopeName()){
441 441
                 throw new BadScopeException($scope, $class);
442 442
             }
443 443
         }
444 444
 
445 445
         // We have to construct class using external injector when we know the exact context
446
-        if ($arguments === [] && $this->binder->hasInjector($class)) {
446
+        if ($arguments === [] && $this->binder->hasInjector($class)){
447 447
             return $this->resolveInjector($this->state->bindings[$ctx->class], $ctx, $arguments);
448 448
         }
449 449
 
450
-        if (!$reflection->isInstantiable()) {
450
+        if (!$reflection->isInstantiable()){
451 451
             $itIs = match (true) {
452 452
                 $reflection->isEnum() => 'Enum',
453 453
                 $reflection->isAbstract() => 'Abstract class',
@@ -460,12 +460,12 @@  discard block
 block discarded – undo
460 460
 
461 461
         $constructor = $reflection->getConstructor();
462 462
 
463
-        if ($constructor !== null) {
464
-            try {
463
+        if ($constructor !== null){
464
+            try{
465 465
                 $this->tracer->push(false, action: 'resolve arguments', signature: $constructor);
466 466
                 $this->tracer->push(true);
467 467
                 $args = $this->resolver->resolveArguments($constructor, $arguments, $this->options->validateArguments);
468
-            } catch (ValidationException $e) {
468
+            }catch (ValidationException $e){
469 469
                 throw new ContainerException(
470 470
                     $this->tracer->combineTraceMessage(
471 471
                         \sprintf(
@@ -475,22 +475,22 @@  discard block
 block discarded – undo
475 475
                         )
476 476
                     ),
477 477
                 );
478
-            } finally {
478
+            }finally{
479 479
                 $this->tracer->pop(true);
480 480
                 $this->tracer->pop(false);
481 481
             }
482
-            try {
482
+            try{
483 483
                 // Using constructor with resolved arguments
484 484
                 $this->tracer->push(false, call: "$class::__construct", arguments: $args);
485 485
                 $this->tracer->push(true);
486 486
                 $instance = new $class(...$args);
487
-            } catch (\TypeError $e) {
487
+            }catch (\TypeError $e){
488 488
                 throw new WrongTypeException($constructor, $e);
489
-            } finally {
489
+            }finally{
490 490
                 $this->tracer->pop(true);
491 491
                 $this->tracer->pop(false);
492 492
             }
493
-        } else {
493
+        }else{
494 494
             // No constructor specified
495 495
             $instance = $reflection->newInstance();
496 496
         }
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
         $instance = $this->runInflector($instance);
509 509
 
510 510
         //Declarative singletons
511
-        if ($this->isSingleton($ctx)) {
511
+        if ($this->isSingleton($ctx)){
512 512
             $this->state->singletons[$ctx->alias] = $instance;
513 513
         }
514 514
 
515 515
         // Register finalizer
516 516
         $finalizer = $this->getFinalizer($ctx, $instance);
517
-        if ($finalizer !== null) {
517
+        if ($finalizer !== null){
518 518
             $this->state->finalizers[] = $finalizer;
519 519
         }
520 520
 
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
      */
527 527
     private function isSingleton(Ctx $ctx): bool
528 528
     {
529
-        if ($ctx->singleton === true) {
529
+        if ($ctx->singleton === true){
530 530
             return true;
531 531
         }
532 532
 
533 533
         /** @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/9489 */
534
-        if ($ctx->reflection->implementsInterface(SingletonInterface::class)) {
534
+        if ($ctx->reflection->implementsInterface(SingletonInterface::class)){
535 535
             return true;
536 536
         }
537 537
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
          * @var Attribute\Finalize|null $attribute
546 546
          */
547 547
         $attribute = ($ctx->reflection->getAttributes(Attribute\Finalize::class)[0] ?? null)?->newInstance();
548
-        if ($attribute === null) {
548
+        if ($attribute === null){
549 549
             return null;
550 550
         }
551 551
 
@@ -559,10 +559,10 @@  discard block
 block discarded – undo
559 559
     {
560 560
         $scope = $this->scope;
561 561
 
562
-        while ($scope !== null) {
563
-            foreach ($this->state->inflectors as $class => $inflectors) {
564
-                if ($instance instanceof $class) {
565
-                    foreach ($inflectors as $inflector) {
562
+        while ($scope !== null){
563
+            foreach ($this->state->inflectors as $class => $inflectors){
564
+                if ($instance instanceof $class){
565
+                    foreach ($inflectors as $inflector){
566 566
                         $instance = $inflector->getParametersCount() > 1
567 567
                             ? $this->invoker->invoke($inflector->inflector, [$instance])
568 568
                             : ($inflector->inflector)($instance);
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
 
579 579
     private function validateArguments(ContextFunction $reflection, array $arguments = []): bool
580 580
     {
581
-        try {
581
+        try{
582 582
             $this->resolver->validateArguments($reflection, $arguments);
583
-        } catch (\Throwable) {
583
+        }catch (\Throwable){
584 584
             return false;
585 585
         }
586 586
 
Please login to merge, or discard this patch.
src/Core/src/Internal/Proxy/Resolver.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,27 +19,27 @@  discard block
 block discarded – undo
19 19
 {
20 20
     public static function resolve(
21 21
         string $alias,
22
-        \Stringable|string|null $context = null,
22
+        \Stringable | string | null $context = null,
23 23
         ?ContainerInterface $c = null,
24 24
     ): object {
25 25
         $c ??= ContainerScope::getContainer() ?? throw new ContainerException('Proxy is out of scope.');
26 26
 
27
-        try {
27
+        try{
28 28
             /** @psalm-suppress TooManyArguments */
29 29
             $result = $c->get($alias, $context) ?? throw new ContainerException(
30 30
                 'Resolved `null` from the container.',
31 31
             );
32
-        } catch (\Throwable $e) {
32
+        }catch (\Throwable $e){
33 33
             $scope = self::getScope($c);
34 34
             throw new ContainerException(
35 35
                 $scope === null
36 36
                     ? "Unable to resolve `{$alias}` in a Proxy."
37 37
                     : \sprintf('Unable to resolve `%s` in a Proxy in `%s` scope.', $alias, \implode('.', $scope)),
38
-                previous: $e,
38
+                previous : $e,
39 39
             );
40 40
         }
41 41
 
42
-        if (!Proxy::isProxy($result)) {
42
+        if (!Proxy::isProxy($result)){
43 43
             return $result;
44 44
         }
45 45
 
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
          * to try to get the instance from the Proxy Fallback Factory.
49 49
          * If there is no the Proxy Fallback Factory, {@see RecursiveProxyException} will be thrown.
50 50
          */
51
-        try {
51
+        try{
52 52
             /** @psalm-suppress TooManyArguments */
53 53
             $result = $c->get($alias, new RetryContext($context));
54
-        } catch (RecursiveProxyException $e) {
54
+        }catch (RecursiveProxyException $e){
55 55
             throw new RecursiveProxyException($e->alias, $e->bindingScope, self::getScope($c));
56 56
         }
57 57
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private static function getScope(ContainerInterface $c): ?array
68 68
     {
69
-        if (!$c instanceof Container) {
70
-            if (!Proxy::isProxy($c)) {
69
+        if (!$c instanceof Container){
70
+            if (!Proxy::isProxy($c)){
71 71
                 return null;
72 72
             }
73 73
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         }
76 76
 
77 77
         return \array_reverse(\array_map(
78
-            static fn (?string $name): string => $name ?? 'null',
78
+            static fn (?string $name) : string => $name ?? 'null',
79 79
             Introspector::scopeNames($c),
80 80
         ));
81 81
     }
Please login to merge, or discard this patch.
src/Core/src/Internal/Proxy/RetryContext.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
      * @param \Stringable|string|null $context Original context.
16 16
      */
17 17
     public function __construct(
18
-        public \Stringable|string|null $context = null,
19
-    ) {
18
+        public \Stringable | string | null $context = null,
19
+    ){
20 20
     }
21 21
 
22 22
     public function __toString(): string
23 23
     {
24
-        return (string) $this->context;
24
+        return (string)$this->context;
25 25
     }
26 26
 }
Please login to merge, or discard this patch.