@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | ?string $comment = null, |
24 | 24 | ?string $namespace = null, |
25 | 25 | private readonly bool $isDomain = false, |
26 | - ) { |
|
26 | + ){ |
|
27 | 27 | parent::__construct($config, $name, $comment, $namespace); |
28 | 28 | } |
29 | 29 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->class->addConstant('SINGLETONS', [])->setProtected(); |
44 | 44 | $this->class->addConstant('DEPENDENCIES', [])->setProtected(); |
45 | 45 | |
46 | - if ($this->isDomain) { |
|
46 | + if ($this->isDomain){ |
|
47 | 47 | $this->class->addConstant('INTERCEPTORS', [])->setProtected(); |
48 | 48 | $this->namespace->addUse(HandlerInterface::class); |
49 | 49 | $this->class->getConstant('SINGLETONS')->setValue([ |
@@ -43,7 +43,8 @@ |
||
43 | 43 | $this->class->addConstant('SINGLETONS', [])->setProtected(); |
44 | 44 | $this->class->addConstant('DEPENDENCIES', [])->setProtected(); |
45 | 45 | |
46 | - if ($this->isDomain) { |
|
46 | + if ($this->isDomain) |
|
47 | + { |
|
47 | 48 | $this->class->addConstant('INTERCEPTORS', [])->setProtected(); |
48 | 49 | $this->namespace->addUse(HandlerInterface::class); |
49 | 50 | $this->class->getConstant('SINGLETONS')->setValue([ |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | private readonly bool $isLegacy; |
24 | 24 | |
25 | 25 | public function __construct( |
26 | - private readonly HandlerInterface|CoreInterface $core, |
|
26 | + private readonly HandlerInterface | CoreInterface $core, |
|
27 | 27 | ?TracerFactoryInterface $tracerFactory = null, |
28 | - ) { |
|
28 | + ){ |
|
29 | 29 | $this->tracerFactory = $tracerFactory ?? new NullTracerFactory(new Container()); |
30 | 30 | $this->isLegacy = !$core instanceof HandlerInterface; |
31 | 31 | } |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | return $tracer->trace( |
52 | 52 | name: \sprintf('Job handling [%s:%s]', $name, $id), |
53 | 53 | callback: $this->isLegacy |
54 | - ? fn (): mixed => $this->core->callAction($name, 'handle', $arguments) |
|
55 | - : fn (): mixed => $this->core->handle(new CallContext(Target::fromPair($name, 'handle'), $arguments)), |
|
56 | - attributes: [ |
|
54 | + ? fn () : mixed => $this->core->callAction($name, 'handle', $arguments) |
|
55 | + : fn () : mixed => $this->core->handle(new CallContext(Target::fromPair($name, 'handle'), $arguments)), |
|
56 | + attributes : [ |
|
57 | 57 | 'queue.driver' => $driver, |
58 | 58 | 'queue.name' => $queue, |
59 | 59 | 'queue.id' => $id, |
60 | 60 | 'queue.headers' => $headers, |
61 | 61 | ], |
62 | - scoped: true, |
|
63 | - traceKind: TraceKind::CONSUMER, |
|
62 | + scoped : true, |
|
63 | + traceKind : TraceKind::CONSUMER, |
|
64 | 64 | ); |
65 | 65 | } |
66 | 66 | } |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | { |
17 | 17 | public function __construct( |
18 | 18 | private readonly FailedJobHandlerInterface $handler |
19 | - ) { |
|
19 | + ){ |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** @psalm-suppress ParamNameMismatch */ |
23 | 23 | public function process(string $name, string $action, array $parameters, CoreInterface $core): mixed |
24 | 24 | { |
25 | - try { |
|
25 | + try{ |
|
26 | 26 | return $core->callAction($name, $action, $parameters); |
27 | - } catch (\Throwable $e) { |
|
28 | - if (!$e instanceof StateException) { |
|
27 | + }catch (\Throwable $e){ |
|
28 | + if (!$e instanceof StateException){ |
|
29 | 29 | $this->handler->handle( |
30 | 30 | $parameters['driver'], |
31 | 31 | $parameters['queue'], |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | |
42 | 42 | public function intercept(CallContextInterface $context, HandlerInterface $handler): mixed |
43 | 43 | { |
44 | - try { |
|
44 | + try{ |
|
45 | 45 | return $handler->handle($context); |
46 | - } catch (\Throwable $e) { |
|
46 | + }catch (\Throwable $e){ |
|
47 | 47 | $args = $context->getArguments(); |
48 | - if (!$e instanceof StateException) { |
|
48 | + if (!$e instanceof StateException){ |
|
49 | 49 | $this->handler->handle( |
50 | 50 | $args['driver'], |
51 | 51 | $args['queue'], |
@@ -22,10 +22,14 @@ discard block |
||
22 | 22 | /** @psalm-suppress ParamNameMismatch */ |
23 | 23 | public function process(string $name, string $action, array $parameters, CoreInterface $core): mixed |
24 | 24 | { |
25 | - try { |
|
25 | + try |
|
26 | + { |
|
26 | 27 | return $core->callAction($name, $action, $parameters); |
27 | - } catch (\Throwable $e) { |
|
28 | - if (!$e instanceof StateException) { |
|
28 | + } |
|
29 | + catch (\Throwable $e) |
|
30 | + { |
|
31 | + if (!$e instanceof StateException) |
|
32 | + { |
|
29 | 33 | $this->handler->handle( |
30 | 34 | $parameters['driver'], |
31 | 35 | $parameters['queue'], |
@@ -41,11 +45,15 @@ discard block |
||
41 | 45 | |
42 | 46 | public function intercept(CallContextInterface $context, HandlerInterface $handler): mixed |
43 | 47 | { |
44 | - try { |
|
48 | + try |
|
49 | + { |
|
45 | 50 | return $handler->handle($context); |
46 | - } catch (\Throwable $e) { |
|
51 | + } |
|
52 | + catch (\Throwable $e) |
|
53 | + { |
|
47 | 54 | $args = $context->getArguments(); |
48 | - if (!$e instanceof StateException) { |
|
55 | + if (!$e instanceof StateException) |
|
56 | + { |
|
49 | 57 | $this->handler->handle( |
50 | 58 | $args['driver'], |
51 | 59 | $args['queue'], |
@@ -59,7 +59,8 @@ discard block |
||
59 | 59 | |
60 | 60 | public function handle(Request $request): Response |
61 | 61 | { |
62 | - if ($this->handler === null) { |
|
62 | + if ($this->handler === null) |
|
63 | + { |
|
63 | 64 | throw new PipelineException('Unable to run pipeline, no handler given.'); |
64 | 65 | } |
65 | 66 | |
@@ -69,9 +70,11 @@ discard block |
||
69 | 70 | |
70 | 71 | $previousRequest = $currentRequest?->get(); |
71 | 72 | $currentRequest?->set($request); |
72 | - try { |
|
73 | + try |
|
74 | + { |
|
73 | 75 | $position = $this->position++; |
74 | - if (!isset($this->middleware[$position])) { |
|
76 | + if (!isset($this->middleware[$position])) |
|
77 | + { |
|
75 | 78 | return $this->handler->handle($request); |
76 | 79 | } |
77 | 80 | |
@@ -103,8 +106,11 @@ discard block |
||
103 | 106 | ], |
104 | 107 | scoped: true |
105 | 108 | ); |
106 | - } finally { |
|
107 | - if ($previousRequest !== null) { |
|
109 | + } |
|
110 | + finally |
|
111 | + { |
|
112 | + if ($previousRequest !== null) |
|
113 | + { |
|
108 | 114 | $currentRequest?->set($previousRequest); |
109 | 115 | } |
110 | 116 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | #[Proxy] ScopeInterface $scope, |
36 | 36 | private readonly ?EventDispatcherInterface $dispatcher = null, |
37 | 37 | ?TracerInterface $tracer = null |
38 | - ) { |
|
38 | + ){ |
|
39 | 39 | $this->tracer = $tracer ?? new NullTracer($scope); |
40 | 40 | } |
41 | 41 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function handle(Request $request): Response |
62 | 62 | { |
63 | - if ($this->handler === null) { |
|
63 | + if ($this->handler === null){ |
|
64 | 64 | throw new PipelineException('Unable to run pipeline, no handler given.'); |
65 | 65 | } |
66 | 66 | |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | |
71 | 71 | $previousRequest = $currentRequest?->get(); |
72 | 72 | $currentRequest?->set($request); |
73 | - try { |
|
73 | + try{ |
|
74 | 74 | $position = $this->position++; |
75 | - if (!isset($this->middleware[$position])) { |
|
75 | + if (!isset($this->middleware[$position])){ |
|
76 | 76 | return $this->handler->handle($request); |
77 | 77 | } |
78 | 78 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | ], |
105 | 105 | scoped: true |
106 | 106 | ); |
107 | - } finally { |
|
108 | - if ($previousRequest !== null) { |
|
107 | + }finally{ |
|
108 | + if ($previousRequest !== null){ |
|
109 | 109 | $currentRequest?->set($previousRequest); |
110 | 110 | } |
111 | 111 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | private readonly CookiesConfig $cookiesConfig, |
35 | 35 | private readonly SessionFactoryInterface $factory, |
36 | 36 | private readonly ScopeInterface $scope |
37 | - ) { |
|
37 | + ){ |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | $this->fetchID($request) |
49 | 49 | ); |
50 | 50 | |
51 | - try { |
|
51 | + try{ |
|
52 | 52 | $response = $handler->handle($request->withAttribute(self::ATTRIBUTE, $session)); |
53 | - } catch (\Throwable $e) { |
|
53 | + }catch (\Throwable $e){ |
|
54 | 54 | $session->abort(); |
55 | 55 | throw $e; |
56 | 56 | } |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | Request $request, |
64 | 64 | Response $response |
65 | 65 | ): Response { |
66 | - if (!$session->isStarted()) { |
|
66 | + if (!$session->isStarted()){ |
|
67 | 67 | return $response; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $session->commit(); |
71 | 71 | |
72 | 72 | //SID changed |
73 | - if ($this->fetchID($request) !== $session->getID()) { |
|
73 | + if ($this->fetchID($request) !== $session->getID()){ |
|
74 | 74 | return $this->withCookie($request, $response, $session->getID()); |
75 | 75 | } |
76 | 76 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | protected function fetchID(Request $request): ?string |
85 | 85 | { |
86 | 86 | $cookies = $request->getCookieParams(); |
87 | - if (empty($cookies[$this->config->getCookie()])) { |
|
87 | + if (empty($cookies[$this->config->getCookie()])){ |
|
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | protected function clientSignature(Request $request): string |
107 | 107 | { |
108 | 108 | $signature = ''; |
109 | - foreach (self::SIGNATURE_HEADERS as $header) { |
|
110 | - $signature .= $request->getHeaderLine($header) . ';'; |
|
109 | + foreach (self::SIGNATURE_HEADERS as $header){ |
|
110 | + $signature .= $request->getHeaderLine($header).';'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return \hash('sha256', $signature); |
@@ -48,9 +48,12 @@ discard block |
||
48 | 48 | $this->fetchID($request) |
49 | 49 | ); |
50 | 50 | |
51 | - try { |
|
51 | + try |
|
52 | + { |
|
52 | 53 | $response = $handler->handle($request->withAttribute(self::ATTRIBUTE, $session)); |
53 | - } catch (\Throwable $e) { |
|
54 | + } |
|
55 | + catch (\Throwable $e) |
|
56 | + { |
|
54 | 57 | $session->abort(); |
55 | 58 | throw $e; |
56 | 59 | } |
@@ -63,14 +66,16 @@ discard block |
||
63 | 66 | Request $request, |
64 | 67 | Response $response |
65 | 68 | ): Response { |
66 | - if (!$session->isStarted()) { |
|
69 | + if (!$session->isStarted()) |
|
70 | + { |
|
67 | 71 | return $response; |
68 | 72 | } |
69 | 73 | |
70 | 74 | $session->commit(); |
71 | 75 | |
72 | 76 | //SID changed |
73 | - if ($this->fetchID($request) !== $session->getID()) { |
|
77 | + if ($this->fetchID($request) !== $session->getID()) |
|
78 | + { |
|
74 | 79 | return $this->withCookie($request, $response, $session->getID()); |
75 | 80 | } |
76 | 81 | |
@@ -84,7 +89,8 @@ discard block |
||
84 | 89 | protected function fetchID(Request $request): ?string |
85 | 90 | { |
86 | 91 | $cookies = $request->getCookieParams(); |
87 | - if (empty($cookies[$this->config->getCookie()])) { |
|
92 | + if (empty($cookies[$this->config->getCookie()])) |
|
93 | + { |
|
88 | 94 | return null; |
89 | 95 | } |
90 | 96 | |
@@ -106,7 +112,8 @@ discard block |
||
106 | 112 | protected function clientSignature(Request $request): string |
107 | 113 | { |
108 | 114 | $signature = ''; |
109 | - foreach (self::SIGNATURE_HEADERS as $header) { |
|
115 | + foreach (self::SIGNATURE_HEADERS as $header) |
|
116 | + { |
|
110 | 117 | $signature .= $request->getHeaderLine($header) . ';'; |
111 | 118 | } |
112 | 119 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function __construct( |
36 | 36 | private readonly ConfiguratorInterface $config, |
37 | 37 | private readonly BinderInterface $binder, |
38 | - ) { |
|
38 | + ){ |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function defineDependencies(): array |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @psalm-param MiddlewareInterface|Autowire|class-string<MiddlewareInterface> Middleware definition |
100 | 100 | */ |
101 | - public function addMiddleware(string|Autowire|MiddlewareInterface $middleware): void |
|
101 | + public function addMiddleware(string | Autowire | MiddlewareInterface $middleware): void |
|
102 | 102 | { |
103 | 103 | $this->config->modify(HttpConfig::CONFIG, new Append('middleware', null, $middleware)); |
104 | 104 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct( |
17 | 17 | private readonly BinderInterface $binder, |
18 | - ) { |
|
18 | + ){ |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function defineDependencies(): array |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | $http->setHandler( |
28 | 28 | static function (ServerRequestInterface $request): void { |
29 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
29 | + if ($request->getAttribute('authContext')->getToken() === null){ |
|
30 | 30 | echo 'no token'; |
31 | - } else { |
|
31 | + }else{ |
|
32 | 32 | echo $request->getAttribute('authContext')->getToken()->getID(); |
33 | 33 | echo ':'; |
34 | 34 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | $http->setHandler( |
52 | 52 | static function (ServerRequestInterface $request): void { |
53 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
53 | + if ($request->getAttribute('authContext')->getToken() === null){ |
|
54 | 54 | echo 'no token'; |
55 | - } else { |
|
55 | + }else{ |
|
56 | 56 | echo $request->getAttribute('authContext')->getToken()->getID(); |
57 | 57 | echo ':'; |
58 | 58 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | |
74 | 74 | $http->setHandler( |
75 | 75 | static function (ServerRequestInterface $request): void { |
76 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
76 | + if ($request->getAttribute('authContext')->getToken() === null){ |
|
77 | 77 | echo 'no token'; |
78 | - } else { |
|
78 | + }else{ |
|
79 | 79 | echo $request->getAttribute('authContext')->getToken()->getID(); |
80 | 80 | echo ':'; |
81 | 81 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | ); |
104 | 104 | $response = $http->handle( |
105 | - new ServerRequest('GET', '',['X-Auth-Token' => 'bad'], 'php://input') |
|
105 | + new ServerRequest('GET', '', ['X-Auth-Token' => 'bad'], 'php://input') |
|
106 | 106 | ); |
107 | 107 | |
108 | 108 | self::assertEmpty($response->getHeader('X-Auth-Token')); |
@@ -26,9 +26,12 @@ discard block |
||
26 | 26 | |
27 | 27 | $http->setHandler( |
28 | 28 | static function (ServerRequestInterface $request): void { |
29 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
29 | + if ($request->getAttribute('authContext')->getToken() === null) |
|
30 | + { |
|
30 | 31 | echo 'no token'; |
31 | - } else { |
|
32 | + } |
|
33 | + else |
|
34 | + { |
|
32 | 35 | echo $request->getAttribute('authContext')->getToken()->getID(); |
33 | 36 | echo ':'; |
34 | 37 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -50,9 +53,12 @@ discard block |
||
50 | 53 | |
51 | 54 | $http->setHandler( |
52 | 55 | static function (ServerRequestInterface $request): void { |
53 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
56 | + if ($request->getAttribute('authContext')->getToken() === null) |
|
57 | + { |
|
54 | 58 | echo 'no token'; |
55 | - } else { |
|
59 | + } |
|
60 | + else |
|
61 | + { |
|
56 | 62 | echo $request->getAttribute('authContext')->getToken()->getID(); |
57 | 63 | echo ':'; |
58 | 64 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -73,9 +79,12 @@ discard block |
||
73 | 79 | |
74 | 80 | $http->setHandler( |
75 | 81 | static function (ServerRequestInterface $request): void { |
76 | - if ($request->getAttribute('authContext')->getToken() === null) { |
|
82 | + if ($request->getAttribute('authContext')->getToken() === null) |
|
83 | + { |
|
77 | 84 | echo 'no token'; |
78 | - } else { |
|
85 | + } |
|
86 | + else |
|
87 | + { |
|
79 | 88 | echo $request->getAttribute('authContext')->getToken()->getID(); |
80 | 89 | echo ':'; |
81 | 90 | echo json_encode($request->getAttribute('authContext')->getToken()->getPayload()); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | self::expectExceptionMessageMatches('/Call to undefined method/i'); |
55 | 55 | |
56 | - $root->invoke(static function (#[Proxy] EmptyInterface $proxy) { |
|
56 | + $root->invoke(static function (#[Proxy] EmptyInterface $proxy){ |
|
57 | 57 | $proxy->bar(name: 'foo'); // Possible to run |
58 | 58 | }); |
59 | 59 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $proxy = $$var; |
94 | 94 | self::assertSame(['foo', 'bar', 'baz', 69], $proxy->extraVariadic('foo', 'bar', 'baz', 69)); |
95 | 95 | self::assertSame( |
96 | - ['foo' => 'foo','zap' => 'bar', 'gas' => 69], |
|
96 | + ['foo' => 'foo', 'zap' => 'bar', 'gas' => 69], |
|
97 | 97 | $proxy->extraVariadic(foo: 'foo', zap: 'bar', gas: 69), |
98 | 98 | ); |
99 | 99 | }); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $root->bindSingleton(MockInterface::class, Stub\MockInterfaceImpl::class); |
179 | 179 | $root->bindSingleton(EmptyInterface::class, Stub\MockInterfaceImpl::class); |
180 | 180 | |
181 | - $mock = $root->invoke(static fn(#[Proxy] MockInterface|EmptyInterface $mock) => $mock); |
|
181 | + $mock = $root->invoke(static fn(#[Proxy] MockInterface | EmptyInterface $mock) => $mock); |
|
182 | 182 | |
183 | 183 | self::assertInstanceOf(MockInterfaceImpl::class, $mock); |
184 | 184 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | { |
232 | 232 | \set_error_handler(static function (int $errno, string $error) use ($interface): void { |
233 | 233 | self::assertSame( |
234 | - \sprintf('Using `%s` outside of the `foo` scope is deprecated and will be ' . |
|
234 | + \sprintf('Using `%s` outside of the `foo` scope is deprecated and will be '. |
|
235 | 235 | 'impossible in version 4.0.', $interface), |
236 | 236 | $error |
237 | 237 | ); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | { |
289 | 289 | \set_error_handler(static function (int $errno, string $error) use ($interface): void { |
290 | 290 | self::assertSame( |
291 | - \sprintf('Using `%s` outside of the `a` scope is deprecated and will be ' . |
|
291 | + \sprintf('Using `%s` outside of the `a` scope is deprecated and will be '. |
|
292 | 292 | 'impossible in version 4.0.', $interface), |
293 | 293 | $error |
294 | 294 | ); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function testDeprecationProxyConfigDontThrowIfNotConstructed(string $interface): void |
317 | 317 | { |
318 | 318 | \set_error_handler(static function (int $errno, string $error) use ($interface): void { |
319 | - self::fail('Unexpected error: ' . $error); |
|
319 | + self::fail('Unexpected error: '.$error); |
|
320 | 320 | }); |
321 | 321 | |
322 | 322 | $root = new Container(); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | #[DataProvider('invalidDeprecationProxyArgsDataProvider')] |
339 | - public function testDeprecationProxyConfigArgsRequiredException(string|null $scope, string|null $version): void |
|
339 | + public function testDeprecationProxyConfigArgsRequiredException(string | null $scope, string | null $version): void |
|
340 | 340 | { |
341 | 341 | self::expectException(\InvalidArgumentException::class); |
342 | 342 | self::expectExceptionMessage('Scope and version or custom message must be provided.'); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | { |
349 | 349 | $proxy = new Config\Proxy(EmptyInterface::class); |
350 | 350 | |
351 | - $this->assertSame(\sprintf('Proxy to `%s`', EmptyInterface::class), (string) $proxy); |
|
351 | + $this->assertSame(\sprintf('Proxy to `%s`', EmptyInterface::class), (string)$proxy); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | public function testProxyConfigNotInterfaceException(): void |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | $root->invoke(static function ( |
37 | 37 | #[Proxy] MockInterface $mock, |
38 | 38 | #[Proxy(/*proxyOverloads: true*/)] EmptyInterface $empty, |
39 | - ) use ($var) { |
|
39 | + ) use ($var) |
|
40 | + { |
|
40 | 41 | /** @var MockInterfaceImpl $proxy */ |
41 | 42 | $proxy = $$var; |
42 | 43 | $proxy->bar(name: 'foo'); // Possible to run |
@@ -53,7 +54,8 @@ discard block |
||
53 | 54 | |
54 | 55 | self::expectExceptionMessageMatches('/Call to undefined method/i'); |
55 | 56 | |
56 | - $root->invoke(static function (#[Proxy] EmptyInterface $proxy) { |
|
57 | + $root->invoke(static function (#[Proxy] EmptyInterface $proxy) |
|
58 | + { |
|
57 | 59 | $proxy->bar(name: 'foo'); // Possible to run |
58 | 60 | }); |
59 | 61 | } |
@@ -68,7 +70,8 @@ discard block |
||
68 | 70 | $root->invoke(static function ( |
69 | 71 | #[Proxy] MockInterface $mock, |
70 | 72 | #[Proxy(/*proxyOverloads: true*/)] EmptyInterface $empty, |
71 | - ) use ($var) { |
|
73 | + ) use ($var) |
|
74 | + { |
|
72 | 75 | /** @var MockInterfaceImpl $proxy */ |
73 | 76 | $proxy = $$var; |
74 | 77 | self::assertSame(['foo', 'bar', 'baz', 69], $proxy->extra('foo', 'bar', 'baz', 69)); |
@@ -88,7 +91,8 @@ discard block |
||
88 | 91 | $root->invoke(static function ( |
89 | 92 | #[Proxy] MockInterface $mock, |
90 | 93 | #[Proxy(/*proxyOverloads: true*/)] EmptyInterface $empty, |
91 | - ) use ($var) { |
|
94 | + ) use ($var) |
|
95 | + { |
|
92 | 96 | /** @var MockInterfaceImpl $proxy */ |
93 | 97 | $proxy = $$var; |
94 | 98 | self::assertSame(['foo', 'bar', 'baz', 69], $proxy->extraVariadic('foo', 'bar', 'baz', 69)); |
@@ -110,7 +114,8 @@ discard block |
||
110 | 114 | $root->bindSingleton(MockInterface::class, Stub\MockInterfaceImpl::class); |
111 | 115 | $root->bindSingleton(EmptyInterface::class, Stub\MockInterfaceImpl::class); |
112 | 116 | |
113 | - $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) { |
|
117 | + $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) |
|
118 | + { |
|
114 | 119 | /** @var MockInterfaceImpl $proxy */ |
115 | 120 | $proxy = $$var; |
116 | 121 | $str = 'bar'; |
@@ -130,7 +135,8 @@ discard block |
||
130 | 135 | $root->bindSingleton(MockInterface::class, Stub\MockInterfaceImpl::class); |
131 | 136 | $root->bindSingleton(EmptyInterface::class, Stub\MockInterfaceImpl::class); |
132 | 137 | |
133 | - $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) { |
|
138 | + $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) |
|
139 | + { |
|
134 | 140 | /** @var MockInterfaceImpl $proxy */ |
135 | 141 | $proxy = $$var; |
136 | 142 | |
@@ -153,7 +159,8 @@ discard block |
||
153 | 159 | $root->bindSingleton(MockInterface::class, Stub\MockInterfaceImpl::class); |
154 | 160 | $root->bindSingleton(EmptyInterface::class, Stub\MockInterfaceImpl::class); |
155 | 161 | |
156 | - $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) { |
|
162 | + $root->invoke(static function (#[Proxy] MockInterface $mock, #[Proxy] EmptyInterface $empty) use ($var) |
|
163 | + { |
|
157 | 164 | /** @var MockInterfaceImpl $proxy */ |
158 | 165 | $proxy = $$var; |
159 | 166 | $str1 = 'bar'; |
@@ -194,7 +201,8 @@ discard block |
||
194 | 201 | $this->assertInstanceOf($interface, $proxy); |
195 | 202 | $this->assertNotInstanceOf(MockInterfaceImpl::class, $proxy); |
196 | 203 | |
197 | - $root->runScope(new Scope('foo'), static function (Container $container) use ($interface, $proxy) { |
|
204 | + $root->runScope(new Scope('foo'), static function (Container $container) use ($interface, $proxy) |
|
205 | + { |
|
198 | 206 | $proxy->bar(name: 'foo'); // Possible to run |
199 | 207 | self::assertSame('foo', $proxy->baz('foo', 42)); |
200 | 208 | self::assertSame(123, $proxy->qux(age: 123)); |
@@ -244,7 +252,8 @@ discard block |
||
244 | 252 | $proxy = $root->get($interface); |
245 | 253 | $this->assertInstanceOf($interface, $proxy); |
246 | 254 | |
247 | - $root->runScope(new Scope('foo'), static function () use ($proxy) { |
|
255 | + $root->runScope(new Scope('foo'), static function () use ($proxy) |
|
256 | + { |
|
248 | 257 | $proxy->bar(name: 'foo'); // Possible to run |
249 | 258 | self::assertSame('foo', $proxy->baz('foo', 42)); |
250 | 259 | self::assertSame(123, $proxy->qux(age: 123)); |
@@ -272,7 +281,8 @@ discard block |
||
272 | 281 | $proxy = $root->get($interface); |
273 | 282 | $this->assertInstanceOf($interface, $proxy); |
274 | 283 | |
275 | - $root->runScope(new Scope('foo'), static function () use ($proxy) { |
|
284 | + $root->runScope(new Scope('foo'), static function () use ($proxy) |
|
285 | + { |
|
276 | 286 | $proxy->bar(name: 'foo'); // Possible to run |
277 | 287 | self::assertSame('foo', $proxy->baz('foo', 42)); |
278 | 288 | self::assertSame(123, $proxy->qux(age: 123)); |
@@ -301,7 +311,8 @@ discard block |
||
301 | 311 | $proxy = $root->get($interface); |
302 | 312 | $this->assertInstanceOf($interface, $proxy); |
303 | 313 | |
304 | - $root->runScope(new Scope('foo'), static function () use ($proxy) { |
|
314 | + $root->runScope(new Scope('foo'), static function () use ($proxy) |
|
315 | + { |
|
305 | 316 | $proxy->bar(name: 'foo'); // Possible to run |
306 | 317 | self::assertSame('foo', $proxy->baz('foo', 42)); |
307 | 318 | self::assertSame(123, $proxy->qux(age: 123)); |
@@ -323,7 +334,8 @@ discard block |
||
323 | 334 | $root->getBinder('foo')->bindSingleton($interface, Stub\MockInterfaceImpl::class); |
324 | 335 | $root->bindSingleton($interface, new Config\DeprecationProxy($interface, true, 'foo', '4.0')); |
325 | 336 | |
326 | - $root->runScope(new Scope('foo'), static function (Container $container) use ($interface) { |
|
337 | + $root->runScope(new Scope('foo'), static function (Container $container) use ($interface) |
|
338 | + { |
|
327 | 339 | $proxy = $container->get($interface); |
328 | 340 | |
329 | 341 | $proxy->bar(name: 'foo'); // Possible to run |