@@ -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 | /** |
| 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(); |
@@ -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('template', [])); |
| 74 | 74 | }); |
| 75 | 75 | $this->app->bind(AbstractCache::class, NullCache::class); |
@@ -61,8 +61,7 @@ |
||
| 61 | 61 | * @class TemplateServiceProvider |
| 62 | 62 | * @package Platine\Framework\Service\Provider |
| 63 | 63 | */ |
| 64 | -class TemplateServiceProvider extends ServiceProvider |
|
| 65 | -{ |
|
| 64 | +class TemplateServiceProvider extends ServiceProvider { |
|
| 66 | 65 | |
| 67 | 66 | /** |
| 68 | 67 | * {@inheritdoc} |
@@ -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 | /** |
| 70 | 69 | * {@inheritdoc} |
@@ -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; |
@@ -71,11 +71,11 @@ |
||
| 71 | 71 | public function register(): void |
| 72 | 72 | { |
| 73 | 73 | $cfg = $this->app->get(Config::class)->get('session', []); |
| 74 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) use ($cfg) { |
|
| 74 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) use ($cfg) { |
|
| 75 | 75 | return new Configuration($cfg); |
| 76 | 76 | }); |
| 77 | 77 | $this->app->bind(Filesystem::class); |
| 78 | - $this->app->bind(SessionHandlerInterface::class, function (ContainerInterface $app) { |
|
| 78 | + $this->app->bind(SessionHandlerInterface::class, function(ContainerInterface $app) { |
|
| 79 | 79 | return new LocalStorage( |
| 80 | 80 | $app->get(Filesystem::class), |
| 81 | 81 | $app->get(Configuration::class) |
@@ -60,8 +60,7 @@ |
||
| 60 | 60 | * @class SessionServiceProvider |
| 61 | 61 | * @package Platine\Framework\Service\Provider |
| 62 | 62 | */ |
| 63 | -class SessionServiceProvider extends ServiceProvider |
|
| 64 | -{ |
|
| 63 | +class SessionServiceProvider extends ServiceProvider { |
|
| 65 | 64 | |
| 66 | 65 | /** |
| 67 | 66 | * {@inheritdoc} |
@@ -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 | /** |
| 66 | 65 | * {@inheritdoc} |
@@ -159,26 +159,3 @@ |
||
| 159 | 159 | private function getTemplateClass(): string |
| 160 | 160 | { |
| 161 | 161 | return <<<EOF |
| 162 | - <?php |
|
| 163 | - namespace Platine\Framework\Migration; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractMigration |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function up(): void |
|
| 171 | - { |
|
| 172 | - //Action when migrate up |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - public function down(): void |
|
| 177 | - { |
|
| 178 | - //Action when migrate down |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - EOF; |
|
| 183 | - } |
|
| 184 | -} |
|
@@ -159,26 +159,3 @@ |
||
| 159 | 159 | private function getTemplateClass(): string |
| 160 | 160 | { |
| 161 | 161 | return <<<EOF |
| 162 | - <?php |
|
| 163 | - namespace Platine\Framework\Migration; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractMigration |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function up(): void |
|
| 171 | - { |
|
| 172 | - //Action when migrate up |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - public function down(): void |
|
| 177 | - { |
|
| 178 | - //Action when migrate down |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - EOF; |
|
| 183 | - } |
|
| 184 | -} |
|
@@ -159,26 +159,3 @@ |
||
| 159 | 159 | private function getTemplateClass(): string |
| 160 | 160 | { |
| 161 | 161 | return <<<EOF |
| 162 | - <?php |
|
| 163 | - namespace Platine\Framework\Migration; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractMigration |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function up(): void |
|
| 171 | - { |
|
| 172 | - //Action when migrate up |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - public function down(): void |
|
| 177 | - { |
|
| 178 | - //Action when migrate down |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - EOF; |
|
| 183 | - } |
|
| 184 | -} |
|
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ) { |
| 81 | 81 | parent::__construct($app, $repository, $config, $filesystem); |
| 82 | 82 | $this->setName('migration:create') |
| 83 | - ->setDescription('Create a new migration'); |
|
| 83 | + ->setDescription('Create a new migration'); |
|
| 84 | 84 | |
| 85 | 85 | $this->addArgument('name', 'name of migration', null, false, true); |
| 86 | 86 | } |
@@ -158,26 +158,3 @@ discard block |
||
| 158 | 158 | private function getTemplateClass(): string |
| 159 | 159 | { |
| 160 | 160 | return <<<EOF |
| 161 | - <?php |
|
| 162 | - namespace Platine\Framework\Migration; |
|
| 163 | - |
|
| 164 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 165 | - |
|
| 166 | - class %classname% extends AbstractMigration |
|
| 167 | - { |
|
| 168 | - |
|
| 169 | - public function up(): void |
|
| 170 | - { |
|
| 171 | - //Action when migrate up |
|
| 172 | - |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - public function down(): void |
|
| 176 | - { |
|
| 177 | - //Action when migrate down |
|
| 178 | - |
|
| 179 | - } |
|
| 180 | - } |
|
| 181 | - EOF; |
|
| 182 | - } |
|
| 183 | -} |
|
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | * @template T |
| 62 | 62 | * @extends AbstractCommand<T> |
| 63 | 63 | */ |
| 64 | -class MigrationCreateCommand extends AbstractCommand |
|
| 65 | -{ |
|
| 64 | +class MigrationCreateCommand extends AbstractCommand { |
|
| 66 | 65 | |
| 67 | 66 | /** |
| 68 | 67 | * The migration name |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | /** |
| 91 | 90 | * {@inheritodc} |
| 92 | 91 | */ |
| 93 | - public function execute() |
|
| 94 | - { |
|
| 92 | + public function execute() { |
|
| 95 | 93 | $writer = $this->io()->writer(); |
| 96 | 94 | |
| 97 | 95 | $version = date('Ymd_His'); |
@@ -160,26 +158,3 @@ discard block |
||
| 160 | 158 | private function getTemplateClass(): string |
| 161 | 159 | { |
| 162 | 160 | return <<<EOF |
| 163 | - <?php |
|
| 164 | - namespace Platine\Framework\Migration; |
|
| 165 | - |
|
| 166 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 167 | - |
|
| 168 | - class %classname% extends AbstractMigration |
|
| 169 | - { |
|
| 170 | - |
|
| 171 | - public function up(): void |
|
| 172 | - { |
|
| 173 | - //Action when migrate up |
|
| 174 | - |
|
| 175 | - } |
|
| 176 | - |
|
| 177 | - public function down(): void |
|
| 178 | - { |
|
| 179 | - //Action when migrate down |
|
| 180 | - |
|
| 181 | - } |
|
| 182 | - } |
|
| 183 | - EOF; |
|
| 184 | - } |
|
| 185 | -} |
|
@@ -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 | /** |
| 69 | 68 | * {@inheritdoc} |
@@ -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 | /** |
| 65 | 64 | * Create new instance |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | /** |
| 80 | 79 | * {@inheritodc} |
| 81 | 80 | */ |
| 82 | - public function execute() |
|
| 83 | - { |
|
| 81 | + public function execute() { |
|
| 84 | 82 | $io = $this->io(); |
| 85 | 83 | $writer = $io->writer(); |
| 86 | 84 | $writer->boldYellow('MIGRATION UPGRADE TO LATEST', true)->eol(); |