@@ -12,6 +12,6 @@ |
||
| 12 | 12 | public function __construct( |
| 13 | 13 | public readonly ServerRequestInterface $request, |
| 14 | 14 | public readonly RouteInterface $route, |
| 15 | - ) { |
|
| 15 | + ){ |
|
| 16 | 16 | } |
| 17 | 17 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function __construct( |
| 10 | 10 | private readonly string $value |
| 11 | - ) { |
|
| 11 | + ){ |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | public function __toString(): string |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | private readonly string $controller, |
| 16 | 16 | int $options = 0, |
| 17 | 17 | string $defaultAction = 'index' |
| 18 | - ) { |
|
| 18 | + ){ |
|
| 19 | 19 | parent::__construct( |
| 20 | 20 | ['action' => null], |
| 21 | 21 | ['action' => null], |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | private readonly array $controllers, |
| 16 | 16 | int $options = 0, |
| 17 | 17 | string $defaultAction = 'index' |
| 18 | - ) { |
|
| 18 | + ){ |
|
| 19 | 19 | parent::__construct( |
| 20 | 20 | ['controller' => null, 'action' => null], |
| 21 | 21 | ['controller' => \array_keys($controllers), 'action' => null], |
@@ -23,16 +23,16 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct( |
| 25 | 25 | private readonly string $controller, |
| 26 | - private readonly string|array $action, |
|
| 26 | + private readonly string | array $action, |
|
| 27 | 27 | int $options = 0 |
| 28 | - ) { |
|
| 29 | - if (\is_string($action)) { |
|
| 28 | + ){ |
|
| 29 | + if (\is_string($action)){ |
|
| 30 | 30 | parent::__construct( |
| 31 | 31 | ['action' => $action], |
| 32 | 32 | ['action' => new Autofill($action)], |
| 33 | 33 | $options |
| 34 | 34 | ); |
| 35 | - } else { |
|
| 35 | + }else{ |
|
| 36 | 36 | parent::__construct( |
| 37 | 37 | ['action' => null], |
| 38 | 38 | ['action' => $action], |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | protected function resolveAction(array $matches): string |
| 50 | 50 | { |
| 51 | 51 | $action = $this->action; |
| 52 | - if (\is_string($action)) { |
|
| 52 | + if (\is_string($action)){ |
|
| 53 | 53 | return $action; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -26,13 +26,16 @@ discard block |
||
| 26 | 26 | private readonly string|array $action, |
| 27 | 27 | int $options = 0 |
| 28 | 28 | ) { |
| 29 | - if (\is_string($action)) { |
|
| 29 | + if (\is_string($action)) |
|
| 30 | + { |
|
| 30 | 31 | parent::__construct( |
| 31 | 32 | ['action' => $action], |
| 32 | 33 | ['action' => new Autofill($action)], |
| 33 | 34 | $options |
| 34 | 35 | ); |
| 35 | - } else { |
|
| 36 | + } |
|
| 37 | + else |
|
| 38 | + { |
|
| 36 | 39 | parent::__construct( |
| 37 | 40 | ['action' => null], |
| 38 | 41 | ['action' => $action], |
@@ -49,7 +52,8 @@ discard block |
||
| 49 | 52 | protected function resolveAction(array $matches): string |
| 50 | 53 | { |
| 51 | 54 | $action = $this->action; |
| 52 | - if (\is_string($action)) { |
|
| 55 | + if (\is_string($action)) |
|
| 56 | + { |
|
| 53 | 57 | return $action; |
| 54 | 58 | } |
| 55 | 59 | |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | public function __construct( |
| 10 | 10 | public readonly ?object $actor, |
| 11 | 11 | public readonly ?string $transport = null |
| 12 | - ) { |
|
| 12 | + ){ |
|
| 13 | 13 | } |
| 14 | 14 | } |
@@ -11,6 +11,6 @@ |
||
| 11 | 11 | public function __construct( |
| 12 | 12 | public readonly TokenInterface $token, |
| 13 | 13 | public readonly ?string $transport = null |
| 14 | - ) { |
|
| 14 | + ){ |
|
| 15 | 15 | } |
| 16 | 16 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function __construct( |
| 19 | 19 | private readonly ActorProviderInterface $actorProvider, |
| 20 | 20 | private readonly ?EventDispatcherInterface $eventDispatcher = null |
| 21 | - ) { |
|
| 21 | + ){ |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function start(TokenInterface $token, string $transport = null): void |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function getActor(): ?object |
| 45 | 45 | { |
| 46 | - if ($this->closed) { |
|
| 46 | + if ($this->closed){ |
|
| 47 | 47 | return null; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ($this->actor === null && $this->token !== null) { |
|
| 50 | + if ($this->actor === null && $this->token !== null){ |
|
| 51 | 51 | $this->actor = $this->actorProvider->getActor($this->token); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -43,11 +43,13 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function getActor(): ?object |
| 45 | 45 | { |
| 46 | - if ($this->closed) { |
|
| 46 | + if ($this->closed) |
|
| 47 | + { |
|
| 47 | 48 | return null; |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | - if ($this->actor === null && $this->token !== null) { |
|
| 51 | + if ($this->actor === null && $this->token !== null) |
|
| 52 | + { |
|
| 51 | 53 | $this->actor = $this->actorProvider->getActor($this->token); |
| 52 | 54 | } |
| 53 | 55 | |
@@ -40,22 +40,22 @@ |
||
| 40 | 40 | public function resolveDomain(UriInterface $uri): ?string |
| 41 | 41 | { |
| 42 | 42 | $host = $uri->getHost(); |
| 43 | - if (empty($host)) { |
|
| 43 | + if (empty($host)){ |
|
| 44 | 44 | return null; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $pattern = $this->config['domain']; |
| 48 | - if (\preg_match("/^(\d{1,3}){4}:\d+$/", $host, $matches)) { |
|
| 48 | + if (\preg_match("/^(\d{1,3}){4}:\d+$/", $host, $matches)){ |
|
| 49 | 49 | // remove port |
| 50 | 50 | $host = $matches[1]; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ($host === 'localhost' || \filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 53 | + if ($host === 'localhost' || \filter_var($host, FILTER_VALIDATE_IP)){ |
|
| 54 | 54 | //We can't use sub-domains when website required by IP |
| 55 | 55 | $pattern = \ltrim($pattern, '.'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if (!str_contains((string) $pattern, '%s')) { |
|
| 58 | + if (!str_contains((string)$pattern, '%s')){ |
|
| 59 | 59 | //Forced domain |
| 60 | 60 | return $pattern; |
| 61 | 61 | } |
@@ -40,22 +40,26 @@ |
||
| 40 | 40 | public function resolveDomain(UriInterface $uri): ?string |
| 41 | 41 | { |
| 42 | 42 | $host = $uri->getHost(); |
| 43 | - if (empty($host)) { |
|
| 43 | + if (empty($host)) |
|
| 44 | + { |
|
| 44 | 45 | return null; |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | $pattern = $this->config['domain']; |
| 48 | - if (\preg_match("/^(\d{1,3}){4}:\d+$/", $host, $matches)) { |
|
| 49 | + if (\preg_match("/^(\d{1,3}){4}:\d+$/", $host, $matches)) |
|
| 50 | + { |
|
| 49 | 51 | // remove port |
| 50 | 52 | $host = $matches[1]; |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | - if ($host === 'localhost' || \filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 55 | + if ($host === 'localhost' || \filter_var($host, FILTER_VALIDATE_IP)) |
|
| 56 | + { |
|
| 54 | 57 | //We can't use sub-domains when website required by IP |
| 55 | 58 | $pattern = \ltrim($pattern, '.'); |
| 56 | 59 | } |
| 57 | 60 | |
| 58 | - if (!str_contains((string) $pattern, '%s')) { |
|
| 61 | + if (!str_contains((string) $pattern, '%s')) |
|
| 62 | + { |
|
| 59 | 63 | //Forced domain |
| 60 | 64 | return $pattern; |
| 61 | 65 | } |