@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function __construct( |
38 | 38 | private readonly ConfiguratorInterface $config |
39 | - ) { |
|
39 | + ){ |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function init(EnvironmentInterface $env): void |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @param class-string<TracerFactoryInterface>|TracerFactoryInterface|Autowire $driver |
49 | 49 | */ |
50 | - public function registerTracer(string $name, string|TracerFactoryInterface|Autowire $driver): void |
|
50 | + public function registerTracer(string $name, string | TracerFactoryInterface | Autowire $driver): void |
|
51 | 51 | { |
52 | 52 | $this->config->modify( |
53 | 53 | TelemetryConfig::CONFIG, |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param non-empty-string|int $code |
29 | 29 | * @param non-empty-string|null $description |
30 | 30 | */ |
31 | - public function setStatus(string|int $code, string $description = null): self; |
|
31 | + public function setStatus(string | int $code, string $description = null): self; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Get the current span status. |
@@ -23,7 +23,7 @@ |
||
23 | 23 | private readonly ClockInterface $clock, |
24 | 24 | private readonly LoggerInterface $logger, |
25 | 25 | private readonly UuidFactoryInterface $uuidFactory |
26 | - ) { |
|
26 | + ){ |
|
27 | 27 | parent::__construct($scope); |
28 | 28 | } |
29 | 29 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $tracerFactory->shouldReceive('make') |
23 | 23 | ->once() |
24 | 24 | ->with(['some' => 'data']) |
25 | - ->andReturn( $tracer = new NullTracer()); |
|
25 | + ->andReturn($tracer = new NullTracer()); |
|
26 | 26 | |
27 | 27 | $handler = new Handler( |
28 | 28 | core: $core = m::mock(CoreInterface::class), |
@@ -18,24 +18,24 @@ |
||
18 | 18 | { |
19 | 19 | public function __construct( |
20 | 20 | private readonly QueueConnectionProviderInterface $queueManager |
21 | - ) { |
|
21 | + ){ |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function createInjection(ReflectionClass $class, string $context = null): QueueInterface |
25 | 25 | { |
26 | - try { |
|
27 | - if ($context === null) { |
|
26 | + try{ |
|
27 | + if ($context === null){ |
|
28 | 28 | $connection = $this->queueManager->getConnection(); |
29 | - } else { |
|
29 | + }else{ |
|
30 | 30 | // Get Queue by context |
31 | - try { |
|
31 | + try{ |
|
32 | 32 | $connection = $this->queueManager->getConnection($context); |
33 | - } catch (InvalidArgumentException) { |
|
33 | + }catch (InvalidArgumentException){ |
|
34 | 34 | // Case when context doesn't match to configured connections |
35 | 35 | return $this->queueManager->getConnection(); |
36 | 36 | } |
37 | 37 | } |
38 | - } catch (\Throwable $e) { |
|
38 | + }catch (\Throwable $e){ |
|
39 | 39 | throw new ContainerException(\sprintf("Can't inject the required queue. %s", $e->getMessage()), 0, $e); |
40 | 40 | } |
41 | 41 |
@@ -23,19 +23,28 @@ |
||
23 | 23 | |
24 | 24 | public function createInjection(ReflectionClass $class, string $context = null): QueueInterface |
25 | 25 | { |
26 | - try { |
|
27 | - if ($context === null) { |
|
26 | + try |
|
27 | + { |
|
28 | + if ($context === null) |
|
29 | + { |
|
28 | 30 | $connection = $this->queueManager->getConnection(); |
29 | - } else { |
|
31 | + } |
|
32 | + else |
|
33 | + { |
|
30 | 34 | // Get Queue by context |
31 | - try { |
|
35 | + try |
|
36 | + { |
|
32 | 37 | $connection = $this->queueManager->getConnection($context); |
33 | - } catch (InvalidArgumentException) { |
|
38 | + } |
|
39 | + catch (InvalidArgumentException) |
|
40 | + { |
|
34 | 41 | // Case when context doesn't match to configured connections |
35 | 42 | return $this->queueManager->getConnection(); |
36 | 43 | } |
37 | 44 | } |
38 | - } catch (\Throwable $e) { |
|
45 | + } |
|
46 | + catch (\Throwable $e) |
|
47 | + { |
|
39 | 48 | throw new ContainerException(\sprintf("Can't inject the required queue. %s", $e->getMessage()), 0, $e); |
40 | 49 | } |
41 | 50 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $factory->shouldReceive('make')->andReturnUsing(function (string $name): QueueInterface { |
88 | 88 | $result = ['sync' => $this->defaultQueue, 'test' => $this->testQueue][$name] ?? null; |
89 | 89 | |
90 | - if ($result === null) { |
|
90 | + if ($result === null){ |
|
91 | 91 | throw new NotFoundException(); |
92 | 92 | } |
93 | 93 | return $result; |
@@ -87,7 +87,8 @@ |
||
87 | 87 | $factory->shouldReceive('make')->andReturnUsing(function (string $name): QueueInterface { |
88 | 88 | $result = ['sync' => $this->defaultQueue, 'test' => $this->testQueue][$name] ?? null; |
89 | 89 | |
90 | - if ($result === null) { |
|
90 | + if ($result === null) |
|
91 | + { |
|
91 | 92 | throw new NotFoundException(); |
92 | 93 | } |
93 | 94 | return $result; |
@@ -57,7 +57,8 @@ discard block |
||
57 | 57 | ] |
58 | 58 | ); |
59 | 59 | |
60 | - $kernel->booting(function () { |
|
60 | + $kernel->booting(function () |
|
61 | + { |
|
61 | 62 | $this->addTransport('cookie', $this->createDefaultCookieTransport()); |
62 | 63 | $this->addTransport('header', new HeaderTransport('X-Auth-Token')); |
63 | 64 | $this->addTokenStorage('session', SessionTokenStorage::class); |
@@ -104,8 +105,10 @@ discard block |
||
104 | 105 | $registry = new TransportRegistry(); |
105 | 106 | $registry->setDefaultTransport($config->getDefaultTransport()); |
106 | 107 | |
107 | - foreach ($config->getTransports() as $name => $transport) { |
|
108 | - if ($transport instanceof Autowire) { |
|
108 | + foreach ($config->getTransports() as $name => $transport) |
|
109 | + { |
|
110 | + if ($transport instanceof Autowire) |
|
111 | + { |
|
109 | 112 | $transport = $transport->resolve($factory); |
110 | 113 | } |
111 | 114 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function __construct( |
43 | 43 | private readonly ConfiguratorInterface $config, |
44 | 44 | private readonly BinderInterface $binder, |
45 | - ) { |
|
45 | + ){ |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function defineDependencies(): array |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ->getBinder(Spiral::Http) |
60 | 60 | ->bind( |
61 | 61 | AuthContextInterface::class, |
62 | - static fn (?ServerRequestInterface $request): AuthContextInterface => |
|
62 | + static fn (?ServerRequestInterface $request) : AuthContextInterface => |
|
63 | 63 | ($request ?? throw new InvalidRequestScopeException(AuthContextInterface::class)) |
64 | 64 | ->getAttribute(AuthMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
65 | 65 | AuthContextInterface::class, |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | ] |
103 | 103 | ); |
104 | 104 | |
105 | - $kernel->booting(function () { |
|
105 | + $kernel->booting(function (){ |
|
106 | 106 | $this->addTransport('cookie', $this->createDefaultCookieTransport()); |
107 | 107 | $this->addTransport('header', new HeaderTransport('X-Auth-Token')); |
108 | 108 | $this->addTokenStorage('session', SessionTokenStorage::class); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param non-empty-string $name |
116 | 116 | * @param Autowire|HttpTransportInterface|class-string<HttpTransportInterface> $transport |
117 | 117 | */ |
118 | - public function addTransport(string $name, Autowire|HttpTransportInterface|string $transport): void |
|
118 | + public function addTransport(string $name, Autowire | HttpTransportInterface | string $transport): void |
|
119 | 119 | { |
120 | 120 | $this->config->modify(AuthConfig::CONFIG, new Append('transports', $name, $transport)); |
121 | 121 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param non-empty-string $name |
127 | 127 | * @param Autowire|TokenStorageInterface|class-string<TokenStorageInterface> $storage |
128 | 128 | */ |
129 | - public function addTokenStorage(string $name, Autowire|TokenStorageInterface|string $storage): void |
|
129 | + public function addTokenStorage(string $name, Autowire | TokenStorageInterface | string $storage): void |
|
130 | 130 | { |
131 | 131 | $this->config->modify(AuthConfig::CONFIG, new Append('storages', $name, $storage)); |
132 | 132 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | $registry = new TransportRegistry(); |
150 | 150 | $registry->setDefaultTransport($config->getDefaultTransport()); |
151 | 151 | |
152 | - foreach ($config->getTransports() as $name => $transport) { |
|
153 | - if ($transport instanceof Autowire) { |
|
152 | + foreach ($config->getTransports() as $name => $transport){ |
|
153 | + if ($transport instanceof Autowire){ |
|
154 | 154 | $transport = $transport->resolve($factory); |
155 | 155 | } |
156 | 156 |
@@ -39,9 +39,9 @@ |
||
39 | 39 | * @return TokenStorageInterface|class-string<TokenStorageInterface>|Autowire |
40 | 40 | * @throws InvalidArgumentException |
41 | 41 | */ |
42 | - public function getStorage(string $name): TokenStorageInterface|string|Autowire |
|
42 | + public function getStorage(string $name): TokenStorageInterface | string | Autowire |
|
43 | 43 | { |
44 | - if (!isset($this->config['storages'][$name])) { |
|
44 | + if (!isset($this->config['storages'][$name])){ |
|
45 | 45 | throw new InvalidArgumentException( |
46 | 46 | \sprintf('Token storage `%s` is not defined.', $name) |
47 | 47 | ); |
@@ -41,7 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | public function getStorage(string $name): TokenStorageInterface|string|Autowire |
43 | 43 | { |
44 | - if (!isset($this->config['storages'][$name])) { |
|
44 | + if (!isset($this->config['storages'][$name])) |
|
45 | + { |
|
45 | 46 | throw new InvalidArgumentException( |
46 | 47 | \sprintf('Token storage `%s` is not defined.', $name) |
47 | 48 | ); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | TransportRegistry $transportRegistry, |
30 | 30 | ?EventDispatcherInterface $eventDispatcher = null, |
31 | 31 | ?string $storage = null |
32 | - ) { |
|
32 | + ){ |
|
33 | 33 | $this->authMiddleware = new AuthTransportMiddleware( |
34 | 34 | $transportName, |
35 | 35 | $scope, |