From 86d2469d6be06d55ad7b9e2f076f6942476f2e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Thu, 21 May 2020 01:39:06 +0200 Subject: [PATCH] Add minimal compatibility with changes in DBAL 2.11 RunSqlCommand Proper fix would be more involved, relying on interfaces in DBAL to not change, which we cannot assume won't happen at this point. Full, proper fix needs to be done once DBAL 2.11 API is stable. Such fix will probably involve deprecating our current command class as well, since DBAL one has everything our command added on top in past. --- Command/Proxy/RunSqlDoctrineCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Command/Proxy/RunSqlDoctrineCommand.php b/Command/Proxy/RunSqlDoctrineCommand.php index edcc7828f..ff6c3b078 100644 --- a/Command/Proxy/RunSqlDoctrineCommand.php +++ b/Command/Proxy/RunSqlDoctrineCommand.php @@ -21,7 +21,6 @@ protected function configure() $this ->setName('doctrine:query:sql') - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command') ->setHelp(<<%command.name% command executes the given SQL query and outputs the results: @@ -29,6 +28,12 @@ protected function configure() php %command.full_name% "SELECT * FROM users" EOT ); + + if ($this->getDefinition()->hasOption('connection')) { + return; + } + + $this->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command'); } /**