@@ -22,7 +22,7 @@ discard block |
||
| 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,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | private function cookieQueue(?ServerRequestInterface $request): CookieQueue |
| 56 | 56 | { |
| 57 | - if ($request === null) { |
|
| 57 | + if ($request === null){ |
|
| 58 | 58 | throw new InvalidRequestScopeException(CookieQueue::class); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -54,7 +54,8 @@ |
||
| 54 | 54 | |
| 55 | 55 | private function cookieQueue(?ServerRequestInterface $request): CookieQueue |
| 56 | 56 | { |
| 57 | - if ($request === null) { |
|
| 57 | + if ($request === null) |
|
| 58 | + { |
|
| 58 | 59 | throw new InvalidRequestScopeException(CookieQueue::class); |
| 59 | 60 | } |
| 60 | 61 | |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | { |
| 20 | 20 | public function __construct( |
| 21 | 21 | string $id, |
| 22 | - string|Container|null $scopeOrContainer = null, |
|
| 23 | - ) { |
|
| 22 | + string | Container | null $scopeOrContainer = null, |
|
| 23 | + ){ |
|
| 24 | 24 | parent::__construct($id, $scopeOrContainer, Spiral::Http->value); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -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 |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function __construct( |
| 42 | 42 | private readonly ConfiguratorInterface $config, |
| 43 | 43 | private readonly BinderInterface $binder, |
| 44 | - ) { |
|
| 44 | + ){ |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function defineDependencies(): array |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | $groups->registerRoutes($router); |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | - if ($kernel instanceof Kernel) { |
|
| 83 | + if ($kernel instanceof Kernel){ |
|
| 84 | 84 | $kernel->appBooted($configuratorCallback); |
| 85 | 85 | $kernel->appBooted($groupsCallback); |
| 86 | - } else { |
|
| 86 | + }else{ |
|
| 87 | 87 | $kernel->booted($configuratorCallback); |
| 88 | 88 | $kernel->booted($groupsCallback); |
| 89 | 89 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | private function route(ServerRequestInterface $request): RouteInterface |
| 114 | 114 | { |
| 115 | 115 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
| 116 | - if ($route === null) { |
|
| 116 | + if ($route === null){ |
|
| 117 | 117 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
| 118 | 118 | } |
| 119 | 119 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | public function __construct( |
| 27 | 27 | private readonly BinderInterface $binder, |
| 28 | - ) { |
|
| 28 | + ){ |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function defineBindings(): array |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ->getBinder(Spiral::Http) |
| 35 | 35 | ->bind( |
| 36 | 36 | SessionInterface::class, |
| 37 | - static fn (?ServerRequestInterface $request): SessionInterface => |
|
| 37 | + static fn (?ServerRequestInterface $request) : SessionInterface => |
|
| 38 | 38 | ($request ?? throw new InvalidRequestScopeException(SessionInterface::class)) |
| 39 | 39 | ->getAttribute(SessionMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
| 40 | 40 | SessionInterface::class, |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'handler' => new Autowire( |
| 76 | 76 | FileHandler::class, |
| 77 | 77 | [ |
| 78 | - 'directory' => $directories->get('runtime') . 'session', |
|
| 78 | + 'directory' => $directories->get('runtime').'session', |
|
| 79 | 79 | 'lifetime' => 86400, |
| 80 | 80 | ] |
| 81 | 81 | ), |
@@ -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 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | public function __construct( |
| 24 | 24 | #[Proxy] private readonly ContainerInterface $container, |
| 25 | - ) { |
|
| 25 | + ){ |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | private function getRequest(): ServerRequestInterface |
| 153 | 153 | { |
| 154 | - try { |
|
| 154 | + try{ |
|
| 155 | 155 | return $this->container->get(ServerRequestInterface::class); |
| 156 | - } catch (NotFoundExceptionInterface $e) { |
|
| 156 | + }catch (NotFoundExceptionInterface $e){ |
|
| 157 | 157 | throw new ScopeException('Unable to receive active request', $e->getCode(), $e); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | private function getCookieQueue(): CookieQueue |
| 165 | 165 | { |
| 166 | - try { |
|
| 166 | + try{ |
|
| 167 | 167 | return $this->container->get(CookieQueue::class); |
| 168 | - } catch (NotFoundExceptionInterface $e) { |
|
| 168 | + }catch (NotFoundExceptionInterface $e){ |
|
| 169 | 169 | throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e); |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | public function __construct( |
| 19 | 19 | #[Proxy] private readonly ContainerInterface $container |
| 20 | - ) { |
|
| 20 | + ){ |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | private function getAuthContext(): AuthContextInterface |
| 72 | 72 | { |
| 73 | - try { |
|
| 73 | + try{ |
|
| 74 | 74 | return $this->container->get(AuthContextInterface::class); |
| 75 | - } catch (NotFoundExceptionInterface $e) { |
|
| 75 | + }catch (NotFoundExceptionInterface $e){ |
|
| 76 | 76 | throw new ScopeException('Unable to resolve auth context, invalid scope', $e->getCode(), $e); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | public function __construct( |
| 21 | 21 | #[Proxy] private readonly ContainerInterface $container |
| 22 | - ) { |
|
| 22 | + ){ |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | private function getTokenStorage(): TokenStorageInterface |
| 59 | 59 | { |
| 60 | - try { |
|
| 60 | + try{ |
|
| 61 | 61 | return $this->container->get(TokenStorageInterface::class); |
| 62 | - } catch (NotFoundExceptionInterface $e) { |
|
| 62 | + }catch (NotFoundExceptionInterface $e){ |
|
| 63 | 63 | throw new ScopeException('Unable to resolve token storage, invalid scope', $e->getCode(), $e); |
| 64 | 64 | } |
| 65 | 65 | } |