@@ -40,8 +40,7 @@ |
||
40 | 40 | * @class HeadersAlreadySentException |
41 | 41 | * @package Platine\Framework\Http\Emitter\Exception |
42 | 42 | */ |
43 | -class HeadersAlreadySentException extends RuntimeException |
|
44 | -{ |
|
43 | +class HeadersAlreadySentException extends RuntimeException { |
|
45 | 44 | /** |
46 | 45 | * Create new instance |
47 | 46 | * @return self |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * @class OutputAlreadySentException |
41 | 41 | * @package Platine\Http\Framework\Emitter\Exception |
42 | 42 | */ |
43 | -class OutputAlreadySentException extends RuntimeException |
|
44 | -{ |
|
43 | +class OutputAlreadySentException extends RuntimeException { |
|
45 | 44 | /** |
46 | 45 | * Create new instance |
47 | 46 | * @return self |
@@ -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].', |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * @class RouteHelper |
56 | 56 | * @package Platine\Framework\Http |
57 | 57 | */ |
58 | -class RouteHelper |
|
59 | -{ |
|
58 | +class RouteHelper { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * The router instance |
@@ -68,8 +67,7 @@ discard block |
||
68 | 67 | * Create new instance |
69 | 68 | * @param Router $router |
70 | 69 | */ |
71 | - public function __construct(Router $router) |
|
72 | - { |
|
70 | + public function __construct(Router $router) { |
|
73 | 71 | $this->router = $router; |
74 | 72 | } |
75 | 73 |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | * @class RouteMatchMiddleware |
61 | 61 | * @package Platine\Framework\Http\Middleware |
62 | 62 | */ |
63 | -class RouteMatchMiddleware implements MiddlewareInterface |
|
64 | -{ |
|
63 | +class RouteMatchMiddleware implements MiddlewareInterface { |
|
65 | 64 | |
66 | 65 | /** |
67 | 66 | * The Router instance |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | * @param Router $router |
81 | 80 | * @param array<string> $allowedMethods the default allowed methods |
82 | 81 | */ |
83 | - public function __construct(Router $router, array $allowedMethods = ['HEAD']) |
|
84 | - { |
|
82 | + public function __construct(Router $router, array $allowedMethods = ['HEAD']) { |
|
85 | 83 | $this->router = $router; |
86 | 84 | |
87 | 85 | 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 MiddlewareResolverInterface $resolver |
74 | 73 | */ |
75 | - public function __construct(MiddlewareResolverInterface $resolver) |
|
76 | - { |
|
74 | + public function __construct(MiddlewareResolverInterface $resolver) { |
|
77 | 75 | $this->resolver = $resolver; |
78 | 76 | } |
79 | 77 |
@@ -66,8 +66,7 @@ |
||
66 | 66 | * @class BaseServiceProvider |
67 | 67 | * @package Platine\Framework\Service\Provider |
68 | 68 | */ |
69 | -class BaseServiceProvider extends ServiceProvider |
|
70 | -{ |
|
69 | +class BaseServiceProvider extends ServiceProvider { |
|
71 | 70 | |
72 | 71 | /** |
73 | 72 | * {@inheritdoc} |
@@ -76,14 +76,14 @@ |
||
76 | 76 | { |
77 | 77 | $this->app->share(Application::class, $this->app); |
78 | 78 | $this->app->share('app', $this->app); |
79 | - $this->app->share(ConsoleApp::class, function () { |
|
79 | + $this->app->share(ConsoleApp::class, function() { |
|
80 | 80 | return new ConsoleApp('PLATINE CONSOLE', '1.0.0'); |
81 | 81 | }); |
82 | 82 | $this->app->share(ContainerInterface::class, $this->app); |
83 | 83 | $this->app->bind(ResolverInterface::class, ConstructorResolver::class); |
84 | 84 | $this->app->bind(RouteCollectionInterface::class, RouteCollection::class); |
85 | 85 | $this->app->bind(MiddlewareResolverInterface::class, MiddlewareResolver::class); |
86 | - $this->app->bind(EmitterInterface::class, function (ContainerInterface $app) { |
|
86 | + $this->app->bind(EmitterInterface::class, function(ContainerInterface $app) { |
|
87 | 87 | return new ResponseEmitter( |
88 | 88 | $app->get(Config::class)->get('app.response_chunck_size', null) |
89 | 89 | ); |
@@ -59,8 +59,7 @@ |
||
59 | 59 | * @class ErrorHandlerServiceProvider |
60 | 60 | * @package Platine\Framework\Service\Provider |
61 | 61 | */ |
62 | -class ErrorHandlerServiceProvider extends ServiceProvider |
|
63 | -{ |
|
62 | +class ErrorHandlerServiceProvider extends ServiceProvider { |
|
64 | 63 | |
65 | 64 | /** |
66 | 65 | * {@inheritdoc} |
@@ -67,11 +67,11 @@ |
||
67 | 67 | */ |
68 | 68 | public function register(): void |
69 | 69 | { |
70 | - $this->app->bind(ErrorHandlerInterface::class, function (ContainerInterface $app) { |
|
70 | + $this->app->bind(ErrorHandlerInterface::class, function(ContainerInterface $app) { |
|
71 | 71 | return new ErrorHandler($app->get(LoggerInterface::class)); |
72 | 72 | }); |
73 | 73 | |
74 | - $this->app->bind(ErrorHandlerMiddleware::class, function (ContainerInterface $app) { |
|
74 | + $this->app->bind(ErrorHandlerMiddleware::class, function(ContainerInterface $app) { |
|
75 | 75 | return new ErrorHandlerMiddleware( |
76 | 76 | $app->get(Config::class)->get('app.debug', false), |
77 | 77 | $app->get(LoggerInterface::class) |
@@ -61,8 +61,7 @@ |
||
61 | 61 | * @class LangServiceProvider |
62 | 62 | * @package Platine\Framework\Service\Provider |
63 | 63 | */ |
64 | -class LangServiceProvider extends ServiceProvider |
|
65 | -{ |
|
64 | +class LangServiceProvider extends ServiceProvider { |
|
66 | 65 | |
67 | 66 | /** |
68 | 67 | * {@inheritdoc} |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | public function register(): void |
71 | 71 | { |
72 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
72 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) { |
|
73 | 73 | return new Configuration($app->get(Config::class)->get('lang', [])); |
74 | 74 | }); |
75 | 75 | $this->app->share(StorageInterface::class, MemoryStorage::class); |