@@ -56,7 +56,7 @@ public function setApplication(Application $application)
56
56
$ this ->application = $ application ;
57
57
}
58
58
59
- public function configureCommand (Command $ command , InputConfiguration $ inputConf )
59
+ public function configureCommand (Command $ command , InputConfiguration $ inputConfig ): void
60
60
{
61
61
$ command
62
62
->setHelp (file_get_contents (__DIR__ .'/../Resources/help/MakeMigration.txt ' ))
@@ -68,12 +68,13 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
68
68
->addOption ('db ' , null , InputOption::VALUE_REQUIRED , 'The database connection name ' )
69
69
->addOption ('em ' , null , InputOption::VALUE_OPTIONAL , 'The entity manager name ' )
70
70
->addOption ('shard ' , null , InputOption::VALUE_REQUIRED , 'The shard connection name ' )
71
- ->addOption ('configuration ' , null , InputOption::VALUE_OPTIONAL , 'The path of doctrine configuration file ' )
72
71
;
73
72
}
74
73
75
74
$ 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
+ ;
77
78
}
78
79
79
80
public function generate (InputInterface $ input , ConsoleStyle $ io , Generator $ generator )
@@ -90,16 +91,16 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
90
91
if ($ input ->hasOption ('shard ' ) && null !== $ input ->getOption ('shard ' )) {
91
92
$ options [] = '--shard= ' .$ input ->getOption ('shard ' );
92
93
}
93
-
94
- if (null !== $ input ->getOption ('configuration ' )) {
95
- $ options [] = '--configuration= ' .$ input ->getOption ('configuration ' );
96
- }
97
94
// end 2.x support
98
95
99
96
if ($ input ->getOption ('formatted ' )) {
100
97
$ options [] = '--formatted ' ;
101
98
}
102
99
100
+ if (null !== $ configuration = $ input ->getOption ('configuration ' )) {
101
+ $ options [] = '--configuration= ' .$ configuration ;
102
+ }
103
+
103
104
$ generateMigrationCommand = $ this ->application ->find ('doctrine:migrations:diff ' );
104
105
$ generateMigrationCommandInput = new ArgvInput ($ options );
105
106
0 commit comments