@@ -56,8 +56,7 @@ |
||
| 56 | 56 | * class MigrationEntity |
| 57 | 57 | * @package Platine\Framework\Migration |
| 58 | 58 | */ |
| 59 | -class MigrationEntity extends Entity |
|
| 60 | -{ |
|
| 59 | +class MigrationEntity extends Entity { |
|
| 61 | 60 | |
| 62 | 61 | /** |
| 63 | 62 | * {@inheritdoc} |
@@ -54,15 +54,13 @@ |
||
| 54 | 54 | * class MigrationRepository |
| 55 | 55 | * @package Platine\Framework\Migration |
| 56 | 56 | */ |
| 57 | -class MigrationRepository extends Repository |
|
| 58 | -{ |
|
| 57 | +class MigrationRepository extends Repository { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * Create new instance |
| 62 | 61 | * @param EntityManager $manager |
| 63 | 62 | */ |
| 64 | - public function __construct(EntityManager $manager) |
|
| 65 | - { |
|
| 63 | + public function __construct(EntityManager $manager) { |
|
| 66 | 64 | parent::__construct($manager, MigrationEntity::class); |
| 67 | 65 | } |
| 68 | 66 | } |
@@ -18,16 +18,14 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @author tony |
| 20 | 20 | */ |
| 21 | -class ConfigCommand extends Command |
|
| 22 | -{ |
|
| 21 | +class ConfigCommand extends Command { |
|
| 23 | 22 | |
| 24 | 23 | protected Application $application; |
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * |
| 28 | 27 | */ |
| 29 | - public function __construct(Application $application) |
|
| 30 | - { |
|
| 28 | + public function __construct(Application $application) { |
|
| 31 | 29 | parent::__construct('config', 'Command to manage configuration'); |
| 32 | 30 | |
| 33 | 31 | $this->addOption('-l|--list', 'List the configuration', '', false); |
@@ -36,8 +34,7 @@ discard block |
||
| 36 | 34 | $this->application = $application; |
| 37 | 35 | } |
| 38 | 36 | |
| 39 | - public function execute() |
|
| 40 | - { |
|
| 37 | + public function execute() { |
|
| 41 | 38 | if ($this->getOptionValue('list')) { |
| 42 | 39 | $this->showConfigList(); |
| 43 | 40 | } |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | * class MigrationResetCommand |
| 58 | 58 | * @package Platine\Framework\Migration\Command |
| 59 | 59 | */ |
| 60 | -class MigrationResetCommand extends AbstractCommand |
|
| 61 | -{ |
|
| 60 | +class MigrationResetCommand extends AbstractCommand { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * 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('ALL MIGRATION ROLLBACK', 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 | /** |
@@ -9,26 +9,26 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->create('roles', function (CreateTable $table) { |
|
| 14 | - $table->integer('id') |
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 17 | - $table->string('description') |
|
| 18 | - ->description('The role description'); |
|
| 19 | - $table->datetime('created_at') |
|
| 20 | - ->description('role created at') |
|
| 21 | - ->notNull(); |
|
| 22 | - $table->datetime('updated_at') |
|
| 23 | - ->description('role updated at'); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->create('roles', function (CreateTable $table) { |
|
| 14 | + $table->integer('id') |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | + $table->string('description') |
|
| 18 | + ->description('The role description'); |
|
| 19 | + $table->datetime('created_at') |
|
| 20 | + ->description('role created at') |
|
| 21 | + ->notNull(); |
|
| 22 | + $table->datetime('updated_at') |
|
| 23 | + ->description('role updated at'); |
|
| 24 | 24 | |
| 25 | - $table->engine('INNODB'); |
|
| 26 | - }); |
|
| 25 | + $table->engine('INNODB'); |
|
| 26 | + }); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function down(): void |
| 30 | 30 | { |
| 31 | - //Action when migrate down |
|
| 32 | - $this->drop('roles'); |
|
| 31 | + //Action when migrate down |
|
| 32 | + $this->drop('roles'); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | 12 | //Action when migrate up |
| 13 | - $this->create('roles', function (CreateTable $table) { |
|
| 13 | + $this->create('roles', function(CreateTable $table) { |
|
| 14 | 14 | $table->integer('id') |
| 15 | 15 | ->autoincrement() |
| 16 | 16 | ->primary(); |
@@ -4,8 +4,7 @@ |
||
| 4 | 4 | use Platine\Database\Schema\CreateTable; |
| 5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
| 6 | 6 | |
| 7 | -class AddRolesTable20210705065247 extends AbstractMigration |
|
| 8 | -{ |
|
| 7 | +class AddRolesTable20210705065247 extends AbstractMigration { |
|
| 9 | 8 | |
| 10 | 9 | public function up(): void |
| 11 | 10 | { |
@@ -9,18 +9,18 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->alter('roles', function (AlterTable $table) { |
|
| 14 | - $table->string('code')->notNull(); |
|
| 15 | - $table->unique('code'); |
|
| 16 | - }); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->alter('roles', function (AlterTable $table) { |
|
| 14 | + $table->string('code')->notNull(); |
|
| 15 | + $table->unique('code'); |
|
| 16 | + }); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function down(): void |
| 20 | 20 | { |
| 21 | - //Action when migrate down |
|
| 22 | - $this->alter('roles', function (AlterTable $table) { |
|
| 23 | - $table->dropColumn('code'); |
|
| 24 | - }); |
|
| 21 | + //Action when migrate down |
|
| 22 | + $this->alter('roles', function (AlterTable $table) { |
|
| 23 | + $table->dropColumn('code'); |
|
| 24 | + }); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | 12 | //Action when migrate up |
| 13 | - $this->alter('roles', function (AlterTable $table) { |
|
| 13 | + $this->alter('roles', function(AlterTable $table) { |
|
| 14 | 14 | $table->string('code')->notNull(); |
| 15 | 15 | $table->unique('code'); |
| 16 | 16 | }); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function down(): void |
| 20 | 20 | { |
| 21 | 21 | //Action when migrate down |
| 22 | - $this->alter('roles', function (AlterTable $table) { |
|
| 22 | + $this->alter('roles', function(AlterTable $table) { |
|
| 23 | 23 | $table->dropColumn('code'); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -4,8 +4,7 @@ |
||
| 4 | 4 | use Platine\Database\Schema\AlterTable; |
| 5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
| 6 | 6 | |
| 7 | -class AddRolesCodeField20210705065339 extends AbstractMigration |
|
| 8 | -{ |
|
| 7 | +class AddRolesCodeField20210705065339 extends AbstractMigration { |
|
| 9 | 8 | |
| 10 | 9 | public function up(): void |
| 11 | 10 | { |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public function register(): void |
| 67 | 67 | { |
| 68 | - $this->app->share(DbConfig::class, function (ContainerInterface $app) { |
|
| 68 | + $this->app->share(DbConfig::class, function(ContainerInterface $app) { |
|
| 69 | 69 | $env = $app->get(Config::class)->get('app.env', ''); |
| 70 | 70 | return new DbConfig($app->get(QueryBuilder::class), $env); |
| 71 | 71 | }); |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * class DatabaseConfigServiceProvider |
| 58 | 58 | * @package Platine\Framework\Service\Provider |
| 59 | 59 | */ |
| 60 | -class DatabaseConfigServiceProvider extends ServiceProvider |
|
| 61 | -{ |
|
| 60 | +class DatabaseConfigServiceProvider extends ServiceProvider { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * {@inheritdoc} |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * @author tony |
| 17 | 17 | */ |
| 18 | -class ListAction implements RequestHandlerInterface |
|
| 19 | -{ |
|
| 18 | +class ListAction implements RequestHandlerInterface { |
|
| 20 | 19 | protected UserRepository $userRepository; |
| 21 | 20 | protected Template $template; |
| 22 | 21 | protected DbConfig $dbConfig; |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @author tony |
| 23 | 23 | */ |
| 24 | -class RouteCommand extends Command |
|
| 25 | -{ |
|
| 24 | +class RouteCommand extends Command { |
|
| 26 | 25 | protected Config $config; |
| 27 | 26 | protected Router $router; |
| 28 | 27 | protected Application $application; |
@@ -30,8 +29,7 @@ discard block |
||
| 30 | 29 | /** |
| 31 | 30 | * |
| 32 | 31 | */ |
| 33 | - public function __construct(Application $application, Config $config, Router $router) |
|
| 34 | - { |
|
| 32 | + public function __construct(Application $application, Config $config, Router $router) { |
|
| 35 | 33 | parent::__construct('route', 'Command to manage route'); |
| 36 | 34 | |
| 37 | 35 | $this->addOption('-l|--list', 'Show route list', null, false); |
@@ -41,8 +39,7 @@ discard block |
||
| 41 | 39 | $this->application = $application; |
| 42 | 40 | } |
| 43 | 41 | |
| 44 | - public function execute() |
|
| 45 | - { |
|
| 42 | + public function execute() { |
|
| 46 | 43 | if ($this->getOptionValue('list')) { |
| 47 | 44 | $this->showRouteList(); |
| 48 | 45 | } |