@@ -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 | -} |
|
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class AbstractSeed |
| 54 | 54 | * @package Platine\Framework\Migration\Seed |
| 55 | 55 | */ |
| 56 | -abstract class AbstractSeed extends QueryBuilder |
|
| 57 | -{ |
|
| 56 | +abstract class AbstractSeed extends QueryBuilder { |
|
| 58 | 57 | /** |
| 59 | 58 | * Run the seed |
| 60 | 59 | * @return void |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | ) { |
| 74 | 74 | parent::__construct($app, $config, $filesystem); |
| 75 | 75 | $this->setName('migration:exec') |
| 76 | - ->setDescription('Command to execute only one seed at a time'); |
|
| 76 | + ->setDescription('Command to execute only one seed at a time'); |
|
| 77 | 77 | |
| 78 | 78 | $this->addOption('-n|--name', 'the seed name', null, false, true); |
| 79 | 79 | } |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | * @template T |
| 60 | 60 | * @extends AbstractSeedCommand<T> |
| 61 | 61 | */ |
| 62 | -class SeedExecuteCommand extends AbstractSeedCommand |
|
| 63 | -{ |
|
| 62 | +class SeedExecuteCommand extends AbstractSeedCommand { |
|
| 64 | 63 | |
| 65 | 64 | /** |
| 66 | 65 | * Create new instance |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | /** |
| 82 | 81 | * {@inheritodc} |
| 83 | 82 | */ |
| 84 | - public function execute() |
|
| 85 | - { |
|
| 83 | + public function execute() { |
|
| 86 | 84 | $io = $this->io(); |
| 87 | 85 | $writer = $io->writer(); |
| 88 | 86 | $writer->boldYellow('SEED EXECUTION', true)->eol(); |
@@ -64,8 +64,7 @@ |
||
| 64 | 64 | * @package Platine\Framework\Migration\Seed\Command |
| 65 | 65 | * @template T |
| 66 | 66 | */ |
| 67 | -abstract class AbstractSeedCommand extends Command |
|
| 68 | -{ |
|
| 67 | +abstract class AbstractSeedCommand extends Command { |
|
| 69 | 68 | |
| 70 | 69 | /** |
| 71 | 70 | * The configuration to use |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ) { |
| 82 | 82 | parent::__construct($app, $config, $filesystem); |
| 83 | 83 | $this->setName('seed:create') |
| 84 | - ->setDescription('Create a new seed'); |
|
| 84 | + ->setDescription('Create a new seed'); |
|
| 85 | 85 | |
| 86 | 86 | $this->addArgument('name', 'name of seed', null, false, true); |
| 87 | 87 | } |
@@ -157,20 +157,3 @@ discard block |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - namespace Platine\Framework\Migration\Seed; |
|
| 162 | - |
|
| 163 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 164 | - |
|
| 165 | - class %classname% extends AbstractSeed |
|
| 166 | - { |
|
| 167 | - |
|
| 168 | - public function run(): void |
|
| 169 | - { |
|
| 170 | - //Action when run the seed |
|
| 171 | - |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - EOF; |
|
| 175 | - } |
|
| 176 | -} |
|
@@ -157,20 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - namespace Platine\Framework\Migration\Seed; |
|
| 162 | - |
|
| 163 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 164 | - |
|
| 165 | - class %classname% extends AbstractSeed |
|
| 166 | - { |
|
| 167 | - |
|
| 168 | - public function run(): void |
|
| 169 | - { |
|
| 170 | - //Action when run the seed |
|
| 171 | - |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - EOF; |
|
| 175 | - } |
|
| 176 | -} |
|
@@ -157,20 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - namespace Platine\Framework\Migration\Seed; |
|
| 162 | - |
|
| 163 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 164 | - |
|
| 165 | - class %classname% extends AbstractSeed |
|
| 166 | - { |
|
| 167 | - |
|
| 168 | - public function run(): void |
|
| 169 | - { |
|
| 170 | - //Action when run the seed |
|
| 171 | - |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - EOF; |
|
| 175 | - } |
|
| 176 | -} |
|
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | * @template T |
| 62 | 62 | * @extends AbstractSeedCommand<T> |
| 63 | 63 | */ |
| 64 | -class SeedCreateCommand extends AbstractSeedCommand |
|
| 65 | -{ |
|
| 64 | +class SeedCreateCommand extends AbstractSeedCommand { |
|
| 66 | 65 | |
| 67 | 66 | /** |
| 68 | 67 | * The seed name |
@@ -89,8 +88,7 @@ discard block |
||
| 89 | 88 | /** |
| 90 | 89 | * {@inheritodc} |
| 91 | 90 | */ |
| 92 | - public function execute() |
|
| 93 | - { |
|
| 91 | + public function execute() { |
|
| 94 | 92 | $writer = $this->io()->writer(); |
| 95 | 93 | |
| 96 | 94 | $className = $this->getSeedClassName($this->name); |
@@ -157,20 +155,3 @@ discard block |
||
| 157 | 155 | private function getTemplateClass(): string |
| 158 | 156 | { |
| 159 | 157 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - namespace Platine\Framework\Migration\Seed; |
|
| 162 | - |
|
| 163 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 164 | - |
|
| 165 | - class %classname% extends AbstractSeed |
|
| 166 | - { |
|
| 167 | - |
|
| 168 | - public function run(): void |
|
| 169 | - { |
|
| 170 | - //Action when run the seed |
|
| 171 | - |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - EOF; |
|
| 175 | - } |
|
| 176 | -} |
|
@@ -157,20 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - namespace Platine\Framework\Migration\Seed; |
|
| 162 | - |
|
| 163 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 164 | - |
|
| 165 | - class %classname% extends AbstractSeed |
|
| 166 | - { |
|
| 167 | - |
|
| 168 | - public function run(): void |
|
| 169 | - { |
|
| 170 | - //Action when run the seed |
|
| 171 | - |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - EOF; |
|
| 175 | - } |
|
| 176 | -} |
|
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | ) { |
| 72 | 72 | parent::__construct($app, $config, $filesystem); |
| 73 | 73 | $this->setName('seed:status') |
| 74 | - ->setDescription('Show your database seeds status'); |
|
| 74 | + ->setDescription('Show your database seeds status'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | * @template T |
| 58 | 58 | * @extends AbstractSeedCommand<T> |
| 59 | 59 | */ |
| 60 | -class SeedStatusCommand extends AbstractSeedCommand |
|
| 61 | -{ |
|
| 60 | +class SeedStatusCommand extends AbstractSeedCommand { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * Create new instance |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | /** |
| 78 | 77 | * {@inheritodc} |
| 79 | 78 | */ |
| 80 | - public function execute() |
|
| 81 | - { |
|
| 79 | + public function execute() { |
|
| 82 | 80 | $writer = $this->io()->writer(); |
| 83 | 81 | $writer->boldYellow('SEED STATUS', true)->eol(); |
| 84 | 82 | $writer->bold('Seed path: '); |