@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | * class Application |
63 | 63 | * @package Platine\Framework\App |
64 | 64 | */ |
65 | -class Application extends AbstractApplication implements RequestHandlerInterface |
|
66 | -{ |
|
65 | +class Application extends AbstractApplication implements RequestHandlerInterface { |
|
67 | 66 | |
68 | 67 | /** |
69 | 68 | * The router instance |
@@ -81,8 +80,7 @@ discard block |
||
81 | 80 | * Create new instance |
82 | 81 | * @param string|null $basePath |
83 | 82 | */ |
84 | - public function __construct(?string $basePath = null) |
|
85 | - { |
|
83 | + public function __construct(?string $basePath = null) { |
|
86 | 84 | parent::__construct($basePath); |
87 | 85 | $this->loadConfiguredMiddlewares(); |
88 | 86 | $this->setRouting(); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | ServerRequestInterface $request, |
149 | 149 | RequestHandlerInterface $handler |
150 | 150 | ): ResponseInterface { |
151 | - set_error_handler(static function (int $severity, string $message, string $file, int $line): bool { |
|
151 | + set_error_handler(static function(int $severity, string $message, string $file, int $line): bool { |
|
152 | 152 | // https://www.php.net/manual/en/function.error-reporting.php#8866 |
153 | 153 | // Usages the defined levels of `error_reporting()`. |
154 | 154 | if (!(error_reporting() & $severity)) { |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | * class ErrorHandlerMiddleware |
64 | 64 | * @package Platine\Framework\Http\Middleware |
65 | 65 | */ |
66 | -class ErrorHandlerMiddleware implements MiddlewareInterface |
|
67 | -{ |
|
66 | +class ErrorHandlerMiddleware implements MiddlewareInterface { |
|
68 | 67 | |
69 | 68 | /** |
70 | 69 | * The logger instance to use to save error |
@@ -101,8 +100,7 @@ discard block |
||
101 | 100 | * @param bool $detail |
102 | 101 | * @param LoggerInterface $logger |
103 | 102 | */ |
104 | - public function __construct(bool $detail, LoggerInterface $logger) |
|
105 | - { |
|
103 | + public function __construct(bool $detail, LoggerInterface $logger) { |
|
106 | 104 | $this->detail = $detail; |
107 | 105 | $this->logger = $logger; |
108 | 106 | $this->errorHandler = $this->getDefaultErrorHanlder(); |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | * class RouteMatchMiddleware |
62 | 62 | * @package Platine\Framework\Http\Middleware |
63 | 63 | */ |
64 | -class RouteMatchMiddleware implements MiddlewareInterface |
|
65 | -{ |
|
64 | +class RouteMatchMiddleware implements MiddlewareInterface { |
|
66 | 65 | |
67 | 66 | /** |
68 | 67 | * The Router instance |
@@ -81,8 +80,7 @@ discard block |
||
81 | 80 | * @param Router $router |
82 | 81 | * @param array<string> $allowedMethods the default allowed methods |
83 | 82 | */ |
84 | - public function __construct(Router $router, array $allowedMethods = ['HEAD']) |
|
85 | - { |
|
83 | + public function __construct(Router $router, array $allowedMethods = ['HEAD']) { |
|
86 | 84 | $this->router = $router; |
87 | 85 | |
88 | 86 | foreach ($allowedMethods as $method) { |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * class RouteDispatcherMiddleware |
60 | 60 | * @package Platine\Framework\Http\Middleware |
61 | 61 | */ |
62 | -class RouteDispatcherMiddleware implements MiddlewareInterface |
|
63 | -{ |
|
62 | +class RouteDispatcherMiddleware implements MiddlewareInterface { |
|
64 | 63 | |
65 | 64 | /** |
66 | 65 | * The Middleware resolver instance |
@@ -72,8 +71,7 @@ discard block |
||
72 | 71 | * Create new instance |
73 | 72 | * @param CallableResolverInterface $resolver |
74 | 73 | */ |
75 | - public function __construct(CallableResolverInterface $resolver) |
|
76 | - { |
|
74 | + public function __construct(CallableResolverInterface $resolver) { |
|
77 | 75 | $this->resolver = $resolver; |
78 | 76 | } |
79 | 77 |
@@ -54,8 +54,7 @@ |
||
54 | 54 | * class EmitterInterface |
55 | 55 | * @package Platine\Framework\Http\Emitter |
56 | 56 | */ |
57 | -interface EmitterInterface |
|
58 | -{ |
|
57 | +interface EmitterInterface { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * Emits a HTTP response, that including status line, headers and message |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * class ResponseEmitter |
59 | 59 | * @package Platine\Framework\Http\Emitter |
60 | 60 | */ |
61 | -class ResponseEmitter implements EmitterInterface |
|
62 | -{ |
|
61 | +class ResponseEmitter implements EmitterInterface { |
|
63 | 62 | |
64 | 63 | /** |
65 | 64 | * The response before length |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | * Create new instance |
72 | 71 | * @param int|null $bufferLength |
73 | 72 | */ |
74 | - public function __construct(?int $bufferLength = null) |
|
75 | - { |
|
73 | + public function __construct(?int $bufferLength = null) { |
|
76 | 74 | if ($bufferLength !== null && $bufferLength < 1) { |
77 | 75 | throw new InvalidArgumentException(sprintf( |
78 | 76 | 'The response buffer length must be greater than zero; received [%d].', |
@@ -37,8 +37,7 @@ |
||
37 | 37 | * HttpNotFoundException |
38 | 38 | * @package Platine\Framework\Http\Exception |
39 | 39 | */ |
40 | -class HttpNotFoundException extends HttpSpecialException |
|
41 | -{ |
|
40 | +class HttpNotFoundException extends HttpSpecialException { |
|
42 | 41 | /** |
43 | 42 | * |
44 | 43 | * @var int |
@@ -37,8 +37,7 @@ |
||
37 | 37 | * HttpMethodNotAllowedException |
38 | 38 | * @package Platine\Framework\Http\Exception |
39 | 39 | */ |
40 | -class HttpMethodNotAllowedException extends HttpSpecialException |
|
41 | -{ |
|
40 | +class HttpMethodNotAllowedException extends HttpSpecialException { |
|
42 | 41 | /** |
43 | 42 | * |
44 | 43 | * @var int |