8000 [make:migration] --configuration is available in all versions by jrushlow · Pull Request #1472 · symfony/maker-bundle · GitHub
[go: up one dir, main page]

Skip to content

[make:migration] --configuration is available in all versions #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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