@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function __construct( |
| 44 | 44 | private readonly ConfiguratorInterface $config |
| 45 | - ) { |
|
| 45 | + ){ |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function init(AbstractKernel $kernel, EnvironmentInterface $env): void |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ] |
| 58 | 58 | ); |
| 59 | 59 | |
| 60 | - $kernel->booting(function () { |
|
| 60 | + $kernel->booting(function (){ |
|
| 61 | 61 | $this->addTransport('cookie', $this->createDefaultCookieTransport()); |
| 62 | 62 | $this->addTransport('header', new HeaderTransport('X-Auth-Token')); |
| 63 | 63 | $this->addTokenStorage('session', SessionTokenStorage::class); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @param non-empty-string $name |
| 71 | 71 | * @param Autowire|HttpTransportInterface|class-string<HttpTransportInterface> $transport |
| 72 | 72 | */ |
| 73 | - public function addTransport(string $name, Autowire|HttpTransportInterface|string $transport): void |
|
| 73 | + public function addTransport(string $name, Autowire | HttpTransportInterface | string $transport): void |
|
| 74 | 74 | { |
| 75 | 75 | $this->config->modify(AuthConfig::CONFIG, new Append('transports', $name, $transport)); |
| 76 | 76 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @param non-empty-string $name |
| 82 | 82 | * @param Autowire|TokenStorageInterface|class-string<TokenStorageInterface> $storage |
| 83 | 83 | */ |
| 84 | - public function addTokenStorage(string $name, Autowire|TokenStorageInterface|string $storage): void |
|
| 84 | + public function addTokenStorage(string $name, Autowire | TokenStorageInterface | string $storage): void |
|
| 85 | 85 | { |
| 86 | 86 | $this->config->modify(AuthConfig::CONFIG, new Append('storages', $name, $storage)); |
| 87 | 87 | } |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | $registry = new TransportRegistry(); |
| 105 | 105 | $registry->setDefaultTransport($config->getDefaultTransport()); |
| 106 | 106 | |
| 107 | - foreach ($config->getTransports() as $name => $transport) { |
|
| 108 | - if ($transport instanceof Autowire) { |
|
| 107 | + foreach ($config->getTransports() as $name => $transport){ |
|
| 108 | + if ($transport instanceof Autowire){ |
|
| 109 | 109 | $transport = $transport->resolve($factory); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -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 | |
@@ -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, |