Skip to content

Commit

Permalink
bug #1472 [make:migration] --configuration is available in all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow authored Mar 4, 2024
1 parent a5a5b01 commit 83945ba
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Maker/MakeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function setApplication(Application $application)
$this->application = $application;
}

public function configureCommand(Command $command, InputConfiguration $inputConf)
public function configureCommand(Command $command, InputConfiguration $inputConfig): void
{
$command
->setHelp(file_get_contents(__DIR__.'/../Resources/help/MakeMigration.txt'))
Expand All @@ -68,12 +68,13 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection name')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager name')
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection name')
->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path of doctrine configuration file')
;
}

$command
->addOption('formatted', null, InputOption::VALUE_NONE, 'Format the generated SQL');
->addOption('formatted', null, InputOption::VALUE_NONE, 'Format the generated SQL')
->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path of doctrine configuration file')
;
}

public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator)
Expand All @@ -90,16 +91,16 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
if ($input->hasOption('shard') && null !== $input->getOption('shard')) {
$options[] = '--shard='.$input->getOption('shard');
}

if (null !== $input->getOption('configuration')) {
$options[] = '--configuration='.$input->getOption('configuration');
}
// end 2.x support

if ($input->getOption('formatted')) {
$options[] = '--formatted';
}

if (null !== $configuration = $input->getOption('configuration')) {
$options[] = '--configuration='.$configuration;
}

$generateMigrationCommand = $this->application->find('doctrine:migrations:diff');
$generateMigrationCommandInput = new ArgvInput($options);

Expand Down

0 comments on commit 83945ba

Please sign in to comment.