connectionProvider = $connectionProvider; } protected function configure(): void { parent::configure(); $this ->setName('doctrine:query:sql') ->setHelp(<<%command.name% command executes the given SQL query and outputs the results: 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'); } protected function execute(InputInterface $input, OutputInterface $output): int { trigger_deprecation( 'doctrine/doctrine-bundle', '2.2', 'The "%s" (doctrine:query:sql) is deprecated, use dbal:run-sql command instead.', self::class ); if (! $this->connectionProvider) { DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection')); // compatibility with doctrine/dbal 2.11+ // where this option is also present and unsupported before we are not switching to use a ConnectionProvider $input->setOption('connection', null); } return parent::execute($input, $output); } }