@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * An HTTP request handler process an HTTP request in order to produce an |
| 57 | 57 | * HTTP response. |
| 58 | 58 | */ |
| 59 | -interface RequestHandlerInterface |
|
| 60 | -{ |
|
| 59 | +interface RequestHandlerInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * Handles a request and produces a response. |
| 63 | 62 | * May call other collaborating code to generate the response. |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * by acting on the request, generating the response, or forwarding the |
| 58 | 58 | * request to a subsequent middleware and possibly acting on its response. |
| 59 | 59 | */ |
| 60 | -interface MiddlewareInterface |
|
| 61 | -{ |
|
| 60 | +interface MiddlewareInterface { |
|
| 62 | 61 | /** |
| 63 | 62 | * Process an incoming server request. |
| 64 | 63 | * |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | * @throws MiddlewareResolverException if the handler is not valid. |
| 80 | 80 | */ |
| 81 | 81 | public function resolve( |
| 82 | - string|MiddlewareInterface|RequestHandlerInterface|callable $handler |
|
| 82 | + string | MiddlewareInterface | RequestHandlerInterface | callable $handler |
|
| 83 | 83 | ): MiddlewareInterface { |
| 84 | 84 | if ($handler instanceof MiddlewareInterface) { |
| 85 | 85 | return $handler; |
@@ -56,15 +56,13 @@ discard block |
||
| 56 | 56 | * @class MiddlewareResolver |
| 57 | 57 | * @package Platine\Http\Handler |
| 58 | 58 | */ |
| 59 | -class MiddlewareResolver implements MiddlewareResolverInterface |
|
| 60 | -{ |
|
| 59 | +class MiddlewareResolver implements MiddlewareResolverInterface { |
|
| 61 | 60 | /** |
| 62 | 61 | * Create new resolver instance |
| 63 | 62 | * @param ContainerInterface|null $container The container instance |
| 64 | 63 | * to use to resolve handler |
| 65 | 64 | */ |
| 66 | - public function __construct(protected ?ContainerInterface $container = null) |
|
| 67 | - { |
|
| 65 | + public function __construct(protected ?ContainerInterface $container = null) { |
|
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | /** |
@@ -114,8 +112,7 @@ discard block |
||
| 114 | 112 | /** |
| 115 | 113 | * @param callable $callable |
| 116 | 114 | */ |
| 117 | - public function __construct($callable) |
|
| 118 | - { |
|
| 115 | + public function __construct($callable) { |
|
| 119 | 116 | $this->callable = $callable; |
| 120 | 117 | } |
| 121 | 118 | |
@@ -143,8 +140,7 @@ discard block |
||
| 143 | 140 | return new class ($handler) implements MiddlewareInterface { |
| 144 | 141 | private RequestHandlerInterface $handler; |
| 145 | 142 | |
| 146 | - public function __construct(RequestHandlerInterface $handler) |
|
| 147 | - { |
|
| 143 | + public function __construct(RequestHandlerInterface $handler) { |
|
| 148 | 144 | $this->handler = $handler; |
| 149 | 145 | } |
| 150 | 146 | |
@@ -168,8 +164,7 @@ discard block |
||
| 168 | 164 | private string $handler; |
| 169 | 165 | private ?ContainerInterface $container; |
| 170 | 166 | |
| 171 | - public function __construct(string $handler, ?ContainerInterface $container) |
|
| 172 | - { |
|
| 167 | + public function __construct(string $handler, ?ContainerInterface $container) { |
|
| 173 | 168 | $this->handler = $handler; |
| 174 | 169 | $this->container = $container; |
| 175 | 170 | } |
@@ -41,8 +41,7 @@ |
||
| 41 | 41 | * @class MiddlewareResolverException |
| 42 | 42 | * @package Platine\Http\Handler\Exception |
| 43 | 43 | */ |
| 44 | -class MiddlewareResolverException extends InvalidArgumentException |
|
| 45 | -{ |
|
| 44 | +class MiddlewareResolverException extends InvalidArgumentException { |
|
| 46 | 45 | /** |
| 47 | 46 | * @param mixed $response |
| 48 | 47 | * @return self |
@@ -62,6 +62,6 @@ |
||
| 62 | 62 | * @return MiddlewareInterface |
| 63 | 63 | */ |
| 64 | 64 | public function resolve( |
| 65 | - string|MiddlewareInterface|RequestHandlerInterface|callable $handler |
|
| 65 | + string | MiddlewareInterface | RequestHandlerInterface | callable $handler |
|
| 66 | 66 | ): MiddlewareInterface; |
| 67 | 67 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class MiddlewareResolverInterface |
| 52 | 52 | * @package Platine\Http\Handler |
| 53 | 53 | */ |
| 54 | -interface MiddlewareResolverInterface |
|
| 55 | -{ |
|
| 54 | +interface MiddlewareResolverInterface { |
|
| 56 | 55 | /** |
| 57 | 56 | * Resolve the given callable by converting it to middleware instance. |
| 58 | 57 | * |