@@ -195,7 +195,7 @@ |
||
| 195 | 195 | protected function getSeedClassName(string $description): string |
| 196 | 196 | { |
| 197 | 197 | $desc = Str::camel($description, false); |
| 198 | - if(!Str::endsWith('Seed', $desc)){ |
|
| 198 | + if (!Str::endsWith('Seed', $desc)) { |
|
| 199 | 199 | $desc .= 'Seed'; |
| 200 | 200 | } |
| 201 | 201 | return $desc; |
@@ -64,8 +64,7 @@ discard block |
||
| 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 |
@@ -195,7 +194,7 @@ discard block |
||
| 195 | 194 | protected function getSeedClassName(string $description): string |
| 196 | 195 | { |
| 197 | 196 | $desc = Str::camel($description, false); |
| 198 | - if(!Str::endsWith('Seed', $desc)){ |
|
| 197 | + if(!Str::endsWith('Seed', $desc)) { |
|
| 199 | 198 | $desc .= 'Seed'; |
| 200 | 199 | } |
| 201 | 200 | return $desc; |
@@ -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,22 +157,3 @@ discard block |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - declare(strict_types=1); |
|
| 162 | - |
|
| 163 | - namespace Platine\Framework\Migration\Seed; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractSeed |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function run(): void |
|
| 171 | - { |
|
| 172 | - //Action when run the seed |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - EOF; |
|
| 177 | - } |
|
| 178 | -} |
|
@@ -157,22 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - declare(strict_types=1); |
|
| 162 | - |
|
| 163 | - namespace Platine\Framework\Migration\Seed; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractSeed |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function run(): void |
|
| 171 | - { |
|
| 172 | - //Action when run the seed |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - EOF; |
|
| 177 | - } |
|
| 178 | -} |
|
@@ -157,22 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - declare(strict_types=1); |
|
| 162 | - |
|
| 163 | - namespace Platine\Framework\Migration\Seed; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractSeed |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function run(): void |
|
| 171 | - { |
|
| 172 | - //Action when run the seed |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - EOF; |
|
| 177 | - } |
|
| 178 | -} |
|
@@ -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,22 +155,3 @@ discard block |
||
| 157 | 155 | private function getTemplateClass(): string |
| 158 | 156 | { |
| 159 | 157 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - declare(strict_types=1); |
|
| 162 | - |
|
| 163 | - namespace Platine\Framework\Migration\Seed; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractSeed |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function run(): void |
|
| 171 | - { |
|
| 172 | - //Action when run the seed |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - EOF; |
|
| 177 | - } |
|
| 178 | -} |
|
@@ -157,22 +157,3 @@ |
||
| 157 | 157 | private function getTemplateClass(): string |
| 158 | 158 | { |
| 159 | 159 | return <<<EOF |
| 160 | - <?php |
|
| 161 | - declare(strict_types=1); |
|
| 162 | - |
|
| 163 | - namespace Platine\Framework\Migration\Seed; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\Seed\AbstractSeed; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractSeed |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function run(): void |
|
| 171 | - { |
|
| 172 | - //Action when run the seed |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - EOF; |
|
| 177 | - } |
|
| 178 | -} |
|
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ) { |
| 83 | 83 | parent::__construct($app, $repository, $config, $filesystem); |
| 84 | 84 | $this->setName('migration:create') |
| 85 | - ->setDescription('Create a new migration'); |
|
| 85 | + ->setDescription('Create a new migration'); |
|
| 86 | 86 | |
| 87 | 87 | $this->addArgument('name', 'name of migration', null, false, true); |
| 88 | 88 | } |
@@ -161,28 +161,3 @@ discard block |
||
| 161 | 161 | private function getTemplateClass(): string |
| 162 | 162 | { |
| 163 | 163 | return <<<EOF |
| 164 | - <?php |
|
| 165 | - declare(strict_types=1); |
|
| 166 | - |
|
| 167 | - namespace Platine\Framework\Migration; |
|
| 168 | - |
|
| 169 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 170 | - |
|
| 171 | - class %classname% extends AbstractMigration |
|
| 172 | - { |
|
| 173 | - |
|
| 174 | - public function up(): void |
|
| 175 | - { |
|
| 176 | - //Action when migrate up |
|
| 177 | - |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - public function down(): void |
|
| 181 | - { |
|
| 182 | - //Action when migrate down |
|
| 183 | - |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - EOF; |
|
| 187 | - } |
|
| 188 | -} |
|
@@ -161,28 +161,3 @@ |
||
| 161 | 161 | private function getTemplateClass(): string |
| 162 | 162 | { |
| 163 | 163 | return <<<EOF |
| 164 | - <?php |
|
| 165 | - declare(strict_types=1); |
|
| 166 | - |
|
| 167 | - namespace Platine\Framework\Migration; |
|
| 168 | - |
|
| 169 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 170 | - |
|
| 171 | - class %classname% extends AbstractMigration |
|
| 172 | - { |
|
| 173 | - |
|
| 174 | - public function up(): void |
|
| 175 | - { |
|
| 176 | - //Action when migrate up |
|
| 177 | - |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - public function down(): void |
|
| 181 | - { |
|
| 182 | - //Action when migrate down |
|
| 183 | - |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - EOF; |
|
| 187 | - } |
|
| 188 | -} |
|
@@ -161,28 +161,3 @@ |
||
| 161 | 161 | private function getTemplateClass(): string |
| 162 | 162 | { |
| 163 | 163 | return <<<EOF |
| 164 | - <?php |
|
| 165 | - declare(strict_types=1); |
|
| 166 | - |
|
| 167 | - namespace Platine\Framework\Migration; |
|
| 168 | - |
|
| 169 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 170 | - |
|
| 171 | - class %classname% extends AbstractMigration |
|
| 172 | - { |
|
| 173 | - |
|
| 174 | - public function up(): void |
|
| 175 | - { |
|
| 176 | - //Action when migrate up |
|
| 177 | - |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - public function down(): void |
|
| 181 | - { |
|
| 182 | - //Action when migrate down |
|
| 183 | - |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - EOF; |
|
| 187 | - } |
|
| 188 | -} |
|
@@ -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'); |
@@ -161,28 +159,3 @@ discard block |
||
| 161 | 159 | private function getTemplateClass(): string |
| 162 | 160 | { |
| 163 | 161 | return <<<EOF |
| 164 | - <?php |
|
| 165 | - declare(strict_types=1); |
|
| 166 | - |
|
| 167 | - namespace Platine\Framework\Migration; |
|
| 168 | - |
|
| 169 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 170 | - |
|
| 171 | - class %classname% extends AbstractMigration |
|
| 172 | - { |
|
| 173 | - |
|
| 174 | - public function up(): void |
|
| 175 | - { |
|
| 176 | - //Action when migrate up |
|
| 177 | - |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - public function down(): void |
|
| 181 | - { |
|
| 182 | - //Action when migrate down |
|
| 183 | - |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - EOF; |
|
| 187 | - } |
|
| 188 | -} |
|
@@ -161,28 +161,3 @@ |
||
| 161 | 161 | private function getTemplateClass(): string |
| 162 | 162 | { |
| 163 | 163 | return <<<EOF |
| 164 | - <?php |
|
| 165 | - declare(strict_types=1); |
|
| 166 | - |
|
| 167 | - namespace Platine\Framework\Migration; |
|
| 168 | - |
|
| 169 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 170 | - |
|
| 171 | - class %classname% extends AbstractMigration |
|
| 172 | - { |
|
| 173 | - |
|
| 174 | - public function up(): void |
|
| 175 | - { |
|
| 176 | - //Action when migrate up |
|
| 177 | - |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - public function down(): void |
|
| 181 | - { |
|
| 182 | - //Action when migrate down |
|
| 183 | - |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - EOF; |
|
| 187 | - } |
|
| 188 | -} |
|