@@ -148,7 +148,7 @@  | 
                                                    ||
| 148 | 148 | ServerRequestInterface $request,  | 
                                                        
| 149 | 149 | RequestHandlerInterface $handler  | 
                                                        
| 150 | 150 |      ): ResponseInterface { | 
                                                        
| 151 | - set_error_handler(static function (  | 
                                                        |
| 151 | + set_error_handler(static function(  | 
                                                        |
| 152 | 152 | int $severity,  | 
                                                        
| 153 | 153 | string $message,  | 
                                                        
| 154 | 154 | string $file,  | 
                                                        
@@ -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 | * The logger instance to use to save error  | 
                                                        
| 70 | 69 | * @var LoggerInterface  | 
                                                        
@@ -100,8 +99,7 @@ discard block  | 
                                                    ||
| 100 | 99 | * @param bool $detail  | 
                                                        
| 101 | 100 | * @param LoggerInterface $logger  | 
                                                        
| 102 | 101 | */  | 
                                                        
| 103 | - public function __construct(bool $detail, LoggerInterface $logger)  | 
                                                        |
| 104 | -    { | 
                                                        |
| 102 | +    public function __construct(bool $detail, LoggerInterface $logger) { | 
                                                        |
| 105 | 103 | $this->detail = $detail;  | 
                                                        
| 106 | 104 | $this->logger = $logger;  | 
                                                        
| 107 | 105 | $this->errorHandler = $this->getDefaultErrorHandler();  | 
                                                        
@@ -70,7 +70,7 @@  | 
                                                    ||
| 70 | 70 | */  | 
                                                        
| 71 | 71 | public function register(): void  | 
                                                        
| 72 | 72 |      { | 
                                                        
| 73 | -        $this->app->bind(Configuration::class, function (ContainerInterface $app) { | 
                                                        |
| 73 | +        $this->app->bind(Configuration::class, function(ContainerInterface $app) { | 
                                                        |
| 74 | 74 |              return new Configuration($app->get(Config::class)->get('cache', [])); | 
                                                        
| 75 | 75 | });  | 
                                                        
| 76 | 76 | $this->app->bind(AdapterInterface::class, LocalAdapter::class);  | 
                                                        
@@ -63,8 +63,7 @@  | 
                                                    ||
| 63 | 63 | * @class CacheServiceProvider  | 
                                                        
| 64 | 64 | * @package Platine\Framework\Service\Provider  | 
                                                        
| 65 | 65 | */  | 
                                                        
| 66 | -class CacheServiceProvider extends ServiceProvider  | 
                                                        |
| 67 | -{ | 
                                                        |
| 66 | +class CacheServiceProvider extends ServiceProvider { | 
                                                        |
| 68 | 67 | /**  | 
                                                        
| 69 | 68 |       * {@inheritdoc} | 
                                                        
| 70 | 69 | */  | 
                                                        
@@ -54,8 +54,7 @@  | 
                                                    ||
| 54 | 54 | * application instance will be returned  | 
                                                        
| 55 | 55 | * @return mixed  | 
                                                        
| 56 | 56 | */  | 
                                                        
| 57 | - function app(?string $identifier = null)  | 
                                                        |
| 58 | -    { | 
                                                        |
| 57 | +    function app(?string $identifier = null) { | 
                                                        |
| 59 | 58 | $app = Application::getInstance();  | 
                                                        
| 60 | 59 | |
| 61 | 60 | return $identifier ? $app->get($identifier) : $app;  | 
                                                        
@@ -67,7 +67,7 @@  | 
                                                    ||
| 67 | 67 | */  | 
                                                        
| 68 | 68 | public function register(): void  | 
                                                        
| 69 | 69 |      { | 
                                                        
| 70 | -        $this->app->bind(LoggerInterface::class, function (ContainerInterface $app) { | 
                                                        |
| 70 | +        $this->app->bind(LoggerInterface::class, function(ContainerInterface $app) { | 
                                                        |
| 71 | 71 | $cfg = new LoggerConfiguration(  | 
                                                        
| 72 | 72 |                  $app->get(Config::class)->get('logging', []) | 
                                                        
| 73 | 73 | );  | 
                                                        
@@ -59,8 +59,7 @@  | 
                                                    ||
| 59 | 59 | * @class LoggerServiceProvider  | 
                                                        
| 60 | 60 | * @package Platine\Framework\Service\Provider  | 
                                                        
| 61 | 61 | */  | 
                                                        
| 62 | -class LoggerServiceProvider extends ServiceProvider  | 
                                                        |
| 63 | -{ | 
                                                        |
| 62 | +class LoggerServiceProvider extends ServiceProvider { | 
                                                        |
| 64 | 63 | /**  | 
                                                        
| 65 | 64 |       * {@inheritdoc} | 
                                                        
| 66 | 65 | */  | 
                                                        
@@ -70,17 +70,17 @@  | 
                                                    ||
| 70 | 70 | */  | 
                                                        
| 71 | 71 | public function register(): void  | 
                                                        
| 72 | 72 |      { | 
                                                        
| 73 | -        $this->app->bind(Configuration::class, function (ContainerInterface $app) { | 
                                                        |
| 73 | +        $this->app->bind(Configuration::class, function(ContainerInterface $app) { | 
                                                        |
| 74 | 74 | /** @template T @var Config<T> $config */  | 
                                                        
| 75 | 75 | $config = $app->get(Config::class);  | 
                                                        
| 76 | 76 |              $driver = $config->get('database.default', 'default'); | 
                                                        
| 77 | 77 | |
| 78 | 78 |              return new Configuration($config->get('database.connections.' . $driver, [])); | 
                                                        
| 79 | 79 | });  | 
                                                        
| 80 | -        $this->app->share(Pool::class, function (ContainerInterface $app) { | 
                                                        |
| 80 | +        $this->app->share(Pool::class, function(ContainerInterface $app) { | 
                                                        |
| 81 | 81 |              return new Pool($app->get(Config::class)->get('database', [])); | 
                                                        
| 82 | 82 | });  | 
                                                        
| 83 | -        $this->app->share(Connection::class, function (ContainerInterface $app) { | 
                                                        |
| 83 | +        $this->app->share(Connection::class, function(ContainerInterface $app) { | 
                                                        |
| 84 | 84 | return new Connection(  | 
                                                        
| 85 | 85 | $app->get(Configuration::class),  | 
                                                        
| 86 | 86 | $app->get(LoggerInterface::class)  | 
                                                        
@@ -62,8 +62,7 @@  | 
                                                    ||
| 62 | 62 | * @class DatabaseServiceProvider  | 
                                                        
| 63 | 63 | * @package Platine\Framework\Service\Provider  | 
                                                        
| 64 | 64 | */  | 
                                                        
| 65 | -class DatabaseServiceProvider extends ServiceProvider  | 
                                                        |
| 66 | -{ | 
                                                        |
| 65 | +class DatabaseServiceProvider extends ServiceProvider { | 
                                                        |
| 67 | 66 | /**  | 
                                                        
| 68 | 67 |       * {@inheritdoc} | 
                                                        
| 69 | 68 | */  | 
                                                        
@@ -71,7 +71,7 @@  | 
                                                    ||
| 71 | 71 |      ) { | 
                                                        
| 72 | 72 | parent::__construct($app, $repository, $config, $filesystem);  | 
                                                        
| 73 | 73 |          $this->setName('migration:migrate') | 
                                                        
| 74 | -             ->setDescription('Upgrade migration to latest'); | 
                                                        |
| 74 | +                ->setDescription('Upgrade migration to latest'); | 
                                                        |
| 75 | 75 | }  | 
                                                        
| 76 | 76 | |
| 77 | 77 | /**  | 
                                                        
@@ -58,8 +58,7 @@ discard block  | 
                                                    ||
| 58 | 58 | * @template T  | 
                                                        
| 59 | 59 | * @extends AbstractCommand<T>  | 
                                                        
| 60 | 60 | */  | 
                                                        
| 61 | -class MigrationMigrateCommand extends AbstractCommand  | 
                                                        |
| 62 | -{ | 
                                                        |
| 61 | +class MigrationMigrateCommand extends AbstractCommand { | 
                                                        |
| 63 | 62 | /**  | 
                                                        
| 64 | 63 | * Create new instance  | 
                                                        
| 65 | 64 |       * {@inheritdoc} | 
                                                        
@@ -78,8 +77,7 @@ discard block  | 
                                                    ||
| 78 | 77 | /**  | 
                                                        
| 79 | 78 |       * {@inheritdoc} | 
                                                        
| 80 | 79 | */  | 
                                                        
| 81 | - public function execute()  | 
                                                        |
| 82 | -    { | 
                                                        |
| 80 | +    public function execute() { | 
                                                        |
| 83 | 81 | $io = $this->io();  | 
                                                        
| 84 | 82 | $writer = $io->writer();  | 
                                                        
| 85 | 83 |          $writer->boldYellow('MIGRATION UPGRADE TO LATEST', true)->eol(); | 
                                                        
@@ -71,7 +71,7 @@  | 
                                                    ||
| 71 | 71 |      ) { | 
                                                        
| 72 | 72 | parent::__construct($app, $repository, $config, $filesystem);  | 
                                                        
| 73 | 73 |          $this->setName('migration:reset') | 
                                                        
| 74 | -             ->setDescription('Rollback all migration done before'); | 
                                                        |
| 74 | +                ->setDescription('Rollback all migration done before'); | 
                                                        |
| 75 | 75 | }  | 
                                                        
| 76 | 76 | |
| 77 | 77 | /**  | 
                                                        
@@ -58,8 +58,7 @@ discard block  | 
                                                    ||
| 58 | 58 | * @template T  | 
                                                        
| 59 | 59 | * @extends AbstractCommand<T>  | 
                                                        
| 60 | 60 | */  | 
                                                        
| 61 | -class MigrationResetCommand extends AbstractCommand  | 
                                                        |
| 62 | -{ | 
                                                        |
| 61 | +class MigrationResetCommand extends AbstractCommand { | 
                                                        |
| 63 | 62 | /**  | 
                                                        
| 64 | 63 | * Create new instance  | 
                                                        
| 65 | 64 |       * {@inheritdoc} | 
                                                        
@@ -78,8 +77,7 @@ discard block  | 
                                                    ||
| 78 | 77 | /**  | 
                                                        
| 79 | 78 |       * {@inheritdoc} | 
                                                        
| 80 | 79 | */  | 
                                                        
| 81 | - public function execute()  | 
                                                        |
| 82 | -    { | 
                                                        |
| 80 | +    public function execute() { | 
                                                        |
| 83 | 81 | $io = $this->io();  | 
                                                        
| 84 | 82 | $writer = $io->writer();  | 
                                                        
| 85 | 83 |          $writer->boldYellow('ALL MIGRATION ROLLBACK', true)->eol(); | 
                                                        
@@ -117,7 +117,7 @@  | 
                                                    ||
| 117 | 117 | protected function createMigrationTable(): void  | 
                                                        
| 118 | 118 |      { | 
                                                        
| 119 | 119 | $tableName = $this->table;  | 
                                                        
| 120 | -        $this->schema->create($tableName, function (CreateTable $table) { | 
                                                        |
| 120 | +        $this->schema->create($tableName, function(CreateTable $table) { | 
                                                        |
| 121 | 121 |              $table->string('version', 20) | 
                                                        
| 122 | 122 |                     ->description('The migration version') | 
                                                        
| 123 | 123 | ->primary();  | 
                                                        
@@ -82,7 +82,7 @@ discard block  | 
                                                    ||
| 82 | 82 |      ) { | 
                                                        
| 83 | 83 | parent::__construct($app, $repository, $config, $filesystem);  | 
                                                        
| 84 | 84 |          $this->setName('migration:init') | 
                                                        
| 85 | -             ->setDescription('Initialize the migration by creating migration table'); | 
                                                        |
| 85 | +                ->setDescription('Initialize the migration by creating migration table'); | 
                                                        |
| 86 | 86 | |
| 87 | 87 | $this->schema = $schema;  | 
                                                        
| 88 | 88 | }  | 
                                                        
@@ -120,10 +120,10 @@ discard block  | 
                                                    ||
| 120 | 120 | $tableName = $this->table;  | 
                                                        
| 121 | 121 |          $this->schema->create($tableName, function (CreateTable $table) { | 
                                                        
| 122 | 122 |              $table->string('version', 20) | 
                                                        
| 123 | -                   ->description('The migration version') | 
                                                        |
| 124 | - ->primary();  | 
                                                        |
| 123 | +                    ->description('The migration version') | 
                                                        |
| 124 | + ->primary();  | 
                                                        |
| 125 | 125 |              $table->string('description') | 
                                                        
| 126 | -                   ->description('The migration description'); | 
                                                        |
| 126 | +                    ->description('The migration description'); | 
                                                        |
| 127 | 127 |              $table->datetime('created_at') | 
                                                        
| 128 | 128 |                      ->description('Migration run time'); | 
                                                        
| 129 | 129 | |
@@ -60,8 +60,7 @@ discard block  | 
                                                    ||
| 60 | 60 | * @template T  | 
                                                        
| 61 | 61 | * @extends AbstractCommand<T>  | 
                                                        
| 62 | 62 | */  | 
                                                        
| 63 | -class MigrationInitCommand extends AbstractCommand  | 
                                                        |
| 64 | -{ | 
                                                        |
| 63 | +class MigrationInitCommand extends AbstractCommand { | 
                                                        |
| 65 | 64 | /**  | 
                                                        
| 66 | 65 | * The schema to use  | 
                                                        
| 67 | 66 | * @var Schema  | 
                                                        
@@ -89,8 +88,7 @@ discard block  | 
                                                    ||
| 89 | 88 | /**  | 
                                                        
| 90 | 89 |       * {@inheritdoc} | 
                                                        
| 91 | 90 | */  | 
                                                        
| 92 | - public function execute()  | 
                                                        |
| 93 | -    { | 
                                                        |
| 91 | +    public function execute() { | 
                                                        |
| 94 | 92 | $io = $this->io();  | 
                                                        
| 95 | 93 | $writer = $io->writer();  | 
                                                        
| 96 | 94 |          $writer->boldYellow('MIGRATION INITIALIZATION', true); | 
                                                        
@@ -72,7 +72,7 @@ discard block  | 
                                                    ||
| 72 | 72 |      ) { | 
                                                        
| 73 | 73 | parent::__construct($app, $repository, $config, $filesystem);  | 
                                                        
| 74 | 74 |          $this->setName('migration:exec') | 
                                                        
| 75 | -             ->setDescription('Execute the migration up/down for one version'); | 
                                                        |
| 75 | +                ->setDescription('Execute the migration up/down for one version'); | 
                                                        |
| 76 | 76 | |
| 77 | 77 |          $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) { | 
                                                        
| 78 | 78 |              if (!in_array($val, ['up', 'down'])) { | 
                                                        
@@ -82,7 +82,7 @@ discard block  | 
                                                    ||
| 82 | 82 | ));  | 
                                                        
| 83 | 83 | }  | 
                                                        
| 84 | 84 | |
| 85 | - return $val;  | 
                                                        |
| 85 | + return $val;  | 
                                                        |
| 86 | 86 | });  | 
                                                        
| 87 | 87 | |
| 88 | 88 |          $this->addOption('-i|--id', 'the migration version', null, false, true); | 
                                                        
@@ -74,7 +74,7 @@  | 
                                                    ||
| 74 | 74 |          $this->setName('migration:exec') | 
                                                        
| 75 | 75 |               ->setDescription('Execute the migration up/down for one version'); | 
                                                        
| 76 | 76 | |
| 77 | -        $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) { | 
                                                        |
| 77 | +        $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function($val) { | 
                                                        |
| 78 | 78 |              if (!in_array($val, ['up', 'down'])) { | 
                                                        
| 79 | 79 | throw new RuntimeException(sprintf(  | 
                                                        
| 80 | 80 | 'Invalid argument type [%s], must be one of [up, down]',  | 
                                                        
@@ -59,8 +59,7 @@ discard block  | 
                                                    ||
| 59 | 59 | * @template T  | 
                                                        
| 60 | 60 | * @extends AbstractCommand<T>  | 
                                                        
| 61 | 61 | */  | 
                                                        
| 62 | -class MigrationExecuteCommand extends AbstractCommand  | 
                                                        |
| 63 | -{ | 
                                                        |
| 62 | +class MigrationExecuteCommand extends AbstractCommand { | 
                                                        |
| 64 | 63 | /**  | 
                                                        
| 65 | 64 | * Create new instance  | 
                                                        
| 66 | 65 |       * {@inheritdoc} | 
                                                        
@@ -92,8 +91,7 @@ discard block  | 
                                                    ||
| 92 | 91 | /**  | 
                                                        
| 93 | 92 |       * {@inheritdoc} | 
                                                        
| 94 | 93 | */  | 
                                                        
| 95 | - public function execute()  | 
                                                        |
| 96 | -    { | 
                                                        |
| 94 | +    public function execute() { | 
                                                        |
| 97 | 95 |          $type = $this->getArgumentValue('type'); | 
                                                        
| 98 | 96 | |
| 99 | 97 | $io = $this->io();  |