Skip to content

Commit 83945ba

Browse files
authored
bug symfony#1472 [make:migration] --configuration is available in all versions
1 parent a5a5b01 commit 83945ba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Maker/MakeMigration.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function setApplication(Application $application)
5656
$this->application = $application;
5757
}
5858

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

7574
$command
76-
->addOption('formatted', null, InputOption::VALUE_NONE, 'Format the generated SQL');
75+
->addOption('formatted', null, InputOption::VALUE_NONE, 'Format the generated SQL')
76+
->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path of doctrine configuration file')
77+
;
7778
}
7879

7980
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator)
@@ -90,16 +91,16 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
9091
if ($input->hasOption('shard') && null !== $input->getOption('shard')) {
9192
$options[] = '--shard='.$input->getOption('shard');
9293
}
93-
94-
if (null !== $input->getOption('configuration')) {
95-
$options[] = '--configuration='.$input->getOption('configuration');
96-
}
9794
// end 2.x support
9895

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

100+
if (null !== $configuration = $input->getOption('configuration')) {
101+
$options[] = '--configuration='.$configuration;
102+
}
103+
103104
$generateMigrationCommand = $this->application->find('doctrine:migrations:diff');
104105
$generateMigrationCommandInput = new ArgvInput($options);
105106

0 commit comments

Comments
 (0)