@@ -124,9 +124,12 @@ |
||
| 124 | 124 | */ |
| 125 | 125 | public function getActiveSession(): SessionInterface |
| 126 | 126 | { |
| 127 | - try { |
|
| 127 | + try |
|
| 128 | + { |
|
| 128 | 129 | return $this->container->get(SessionInterface::class); |
| 129 | - } catch (NotFoundExceptionInterface $e) { |
|
| 130 | + } |
|
| 131 | + catch (NotFoundExceptionInterface $e) |
|
| 132 | + { |
|
| 130 | 133 | throw new ScopeException( |
| 131 | 134 | 'Unable to receive active session, invalid request scope', |
| 132 | 135 | $e->getCode(), |
@@ -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 | /** |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function getActiveSession(): SessionInterface |
| 98 | 98 | { |
| 99 | - try { |
|
| 99 | + try{ |
|
| 100 | 100 | return $this->container->get(SessionInterface::class); |
| 101 | - } catch (NotFoundExceptionInterface $e) { |
|
| 101 | + }catch (NotFoundExceptionInterface $e){ |
|
| 102 | 102 | throw new ScopeException( |
| 103 | 103 | 'Unable to receive active session, invalid request scope', |
| 104 | 104 | $e->getCode(), |
@@ -169,9 +169,12 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | private function getRequest(): ServerRequestInterface |
| 171 | 171 | { |
| 172 | - try { |
|
| 172 | + try |
|
| 173 | + { |
|
| 173 | 174 | return $this->container->get(ServerRequestInterface::class); |
| 174 | - } catch (NotFoundExceptionInterface $e) { |
|
| 175 | + } |
|
| 176 | + catch (NotFoundExceptionInterface $e) |
|
| 177 | + { |
|
| 175 | 178 | throw new ScopeException('Unable to receive active request', $e->getCode(), $e); |
| 176 | 179 | } |
| 177 | 180 | } |
@@ -183,9 +186,12 @@ discard block |
||
| 183 | 186 | */ |
| 184 | 187 | private function getCookieQueue(): CookieQueue |
| 185 | 188 | { |
| 186 | - try { |
|
| 189 | + try |
|
| 190 | + { |
|
| 187 | 191 | return $this->container->get(CookieQueue::class); |
| 188 | - } catch (NotFoundExceptionInterface $e) { |
|
| 192 | + } |
|
| 193 | + catch (NotFoundExceptionInterface $e) |
|
| 194 | + { |
|
| 189 | 195 | throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e); |
| 190 | 196 | } |
| 191 | 197 | } |
@@ -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 | } |
@@ -87,8 +87,10 @@ |
||
| 87 | 87 | $registry = new TransportRegistry(); |
| 88 | 88 | $registry->setDefaultTransport($config->getDefaultTransport()); |
| 89 | 89 | |
| 90 | - foreach ($config->getTransports() as $name => $transport) { |
|
| 91 | - if ($transport instanceof Autowire) { |
|
| 90 | + foreach ($config->getTransports() as $name => $transport) |
|
| 91 | + { |
|
| 92 | + if ($transport instanceof Autowire) |
|
| 93 | + { |
|
| 92 | 94 | $transport = $transport->resolve($factory); |
| 93 | 95 | } |
| 94 | 96 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | public function __construct( |
| 43 | 43 | private readonly ConfiguratorInterface $config, |
| 44 | - ) { |
|
| 44 | + ){ |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function defineDependencies(): array |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $httpBinder->bindSingleton(TokenStorageInterface::class, [self::class, 'getTokenStorage']); |
| 78 | 78 | $httpBinder->bind( |
| 79 | 79 | AuthContextInterface::class, |
| 80 | - static fn (?ServerRequestInterface $request): AuthContextInterface => |
|
| 80 | + static fn (?ServerRequestInterface $request) : AuthContextInterface => |
|
| 81 | 81 | ($request ?? throw new InvalidRequestScopeException(AuthContextInterface::class)) |
| 82 | 82 | ->getAttribute(AuthMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
| 83 | 83 | AuthContextInterface::class, |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param non-empty-string $name |
| 112 | 112 | * @param Autowire|HttpTransportInterface|class-string<HttpTransportInterface> $transport |
| 113 | 113 | */ |
| 114 | - public function addTransport(string $name, Autowire|HttpTransportInterface|string $transport): void |
|
| 114 | + public function addTransport(string $name, Autowire | HttpTransportInterface | string $transport): void |
|
| 115 | 115 | { |
| 116 | 116 | $this->config->modify(AuthConfig::CONFIG, new Append('transports', $name, $transport)); |
| 117 | 117 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param non-empty-string $name |
| 123 | 123 | * @param Autowire|TokenStorageInterface|class-string<TokenStorageInterface> $storage |
| 124 | 124 | */ |
| 125 | - public function addTokenStorage(string $name, Autowire|TokenStorageInterface|string $storage): void |
|
| 125 | + public function addTokenStorage(string $name, Autowire | TokenStorageInterface | string $storage): void |
|
| 126 | 126 | { |
| 127 | 127 | $this->config->modify(AuthConfig::CONFIG, new Append('storages', $name, $storage)); |
| 128 | 128 | } |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | $registry = new TransportRegistry(); |
| 146 | 146 | $registry->setDefaultTransport($config->getDefaultTransport()); |
| 147 | 147 | |
| 148 | - foreach ($config->getTransports() as $name => $transport) { |
|
| 149 | - if ($transport instanceof Autowire) { |
|
| 148 | + foreach ($config->getTransports() as $name => $transport){ |
|
| 149 | + if ($transport instanceof Autowire){ |
|
| 150 | 150 | $transport = $transport->resolve($factory); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -18,5 +18,5 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @var string |
| 20 | 20 | */ |
| 21 | - protected const FIXTURE_DIRECTORY = __DIR__ . '/fixtures/'; |
|
| 21 | + protected const FIXTURE_DIRECTORY = __DIR__.'/fixtures/'; |
|
| 22 | 22 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected static function filter($v) |
| 22 | 22 | { |
| 23 | - if (is_array($v)) { |
|
| 23 | + if (is_array($v)){ |
|
| 24 | 24 | throw new RuntimeException("can't be array"); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected static function filter($v) |
| 22 | 22 | { |
| 23 | - if (is_array($v)) { |
|
| 23 | + if (is_array($v)) |
|
| 24 | + { |
|
| 24 | 25 | throw new RuntimeException("can't be array"); |
| 25 | 26 | } |
| 26 | 27 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected function isNullable(string $field): bool |
| 22 | 22 | { |
| 23 | - if (parent::isNullable($field)) { |
|
| 23 | + if (parent::isNullable($field)){ |
|
| 24 | 24 | return true; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected function isNullable(string $field): bool |
| 22 | 22 | { |
| 23 | - if (parent::isNullable($field)) { |
|
| 23 | + if (parent::isNullable($field)) |
|
| 24 | + { |
|
| 24 | 25 | return true; |
| 25 | 26 | } |
| 26 | 27 | |
@@ -29,25 +29,25 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | protected function mapDirectories(array $directories): array |
| 31 | 31 | { |
| 32 | - if (!isset($directories['root'])) { |
|
| 32 | + if (!isset($directories['root'])){ |
|
| 33 | 33 | throw new BootException('Missing required directory `root`.'); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (!isset($directories['app'])) { |
|
| 37 | - $directories['app'] = $directories['root'] . '/app/'; |
|
| 36 | + if (!isset($directories['app'])){ |
|
| 37 | + $directories['app'] = $directories['root'].'/app/'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return array_merge([ |
| 41 | 41 | // public root |
| 42 | - 'public' => $directories['root'] . '/public/', |
|
| 42 | + 'public' => $directories['root'].'/public/', |
|
| 43 | 43 | |
| 44 | 44 | // data directories |
| 45 | - 'runtime' => $directories['root'] . '/runtime/', |
|
| 46 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
| 45 | + 'runtime' => $directories['root'].'/runtime/', |
|
| 46 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
| 47 | 47 | |
| 48 | 48 | // application directories |
| 49 | - 'config' => $directories['app'] . '/config/', |
|
| 50 | - 'resources' => $directories['app'] . '/resources/', |
|
| 49 | + 'config' => $directories['app'].'/config/', |
|
| 50 | + 'resources' => $directories['app'].'/resources/', |
|
| 51 | 51 | ], $directories); |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -43,11 +43,13 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | protected function mapDirectories(array $directories): array |
| 45 | 45 | { |
| 46 | - if (!isset($directories['root'])) { |
|
| 46 | + if (!isset($directories['root'])) |
|
| 47 | + { |
|
| 47 | 48 | throw new BootException('Missing required directory `root`.'); |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | - if (!isset($directories['app'])) { |
|
| 51 | + if (!isset($directories['app'])) |
|
| 52 | + { |
|
| 51 | 53 | $directories['app'] = $directories['root'] . '/app/'; |
| 52 | 54 | } |
| 53 | 55 | |
@@ -43,11 +43,13 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | protected function mapDirectories(array $directories): array |
| 45 | 45 | { |
| 46 | - if (!isset($directories['root'])) { |
|
| 46 | + if (!isset($directories['root'])) |
|
| 47 | + { |
|
| 47 | 48 | throw new BootException('Missing required directory `root`.'); |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | - if (!isset($directories['app'])) { |
|
| 51 | + if (!isset($directories['app'])) |
|
| 52 | + { |
|
| 51 | 53 | $directories['app'] = $directories['root'] . '/app/'; |
| 52 | 54 | } |
| 53 | 55 | |
@@ -43,25 +43,25 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | protected function mapDirectories(array $directories): array |
| 45 | 45 | { |
| 46 | - if (!isset($directories['root'])) { |
|
| 46 | + if (!isset($directories['root'])){ |
|
| 47 | 47 | throw new BootException('Missing required directory `root`.'); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (!isset($directories['app'])) { |
|
| 51 | - $directories['app'] = $directories['root'] . '/app/'; |
|
| 50 | + if (!isset($directories['app'])){ |
|
| 51 | + $directories['app'] = $directories['root'].'/app/'; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return array_merge([ |
| 55 | 55 | // public root |
| 56 | - 'public' => $directories['root'] . '/public/', |
|
| 56 | + 'public' => $directories['root'].'/public/', |
|
| 57 | 57 | |
| 58 | 58 | // data directories |
| 59 | - 'runtime' => $directories['root'] . '/runtime/', |
|
| 60 | - 'cache' => $directories['root'] . '/runtime/cache/', |
|
| 59 | + 'runtime' => $directories['root'].'/runtime/', |
|
| 60 | + 'cache' => $directories['root'].'/runtime/cache/', |
|
| 61 | 61 | |
| 62 | 62 | // application directories |
| 63 | - 'config' => $directories['app'] . '/config/', |
|
| 64 | - 'resources' => $directories['app'] . '/resources/', |
|
| 63 | + 'config' => $directories['app'].'/config/', |
|
| 64 | + 'resources' => $directories['app'].'/resources/', |
|
| 65 | 65 | ], $directories); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function perform(): void |
| 24 | 24 | { |
| 25 | - throw new Exception('Unhandled another failed command error at ' . __METHOD__ . ' (line ' . __LINE__ . ')'); |
|
| 25 | + throw new Exception('Unhandled another failed command error at '.__METHOD__.' (line '.__LINE__.')'); |
|
| 26 | 26 | } |
| 27 | 27 | } |