diff --git a/src/Maker/MakeMigration.php b/src/Maker/MakeMigration.php index 52567a115..74c19c9ec 100644 --- a/src/Maker/MakeMigration.php +++ b/src/Maker/MakeMigration.php @@ -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')) @@ -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) @@ -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);