From 2f559255ea846ee99740baa8e197160cf48b5577 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Mon, 28 Oct 2019 09:24:42 +0100 Subject: [PATCH] add missing exit codes to ensure Symfony 5 compatibility --- lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php | 4 ++-- lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php | 2 ++ tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php index a45a60c6085..0cd2999c97a 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php @@ -58,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $fileNames = $input->getArgument('file'); if ($fileNames === null) { - return null; + return 0; } foreach ((array) $fileNames as $fileName) { @@ -133,6 +133,6 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - return null; + return 0; } } diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php index 8aeb0ea2fba..b479baec2ee 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php @@ -68,5 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->write(Dumper::dump($resultSet, (int) $depth)); + + return 0; } } diff --git a/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php b/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php index 21eab4203ba..202748be6d8 100644 --- a/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php +++ b/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php @@ -70,10 +70,11 @@ public function testSelectStatementsPrintsResult() : void { $this->expectConnectionFetchAll(); - $this->commandTester->execute([ + $exitCode = $this->commandTester->execute([ 'command' => $this->command->getName(), 'sql' => 'SELECT 1', ]); + $this->assertSame(0, $exitCode); self::assertRegExp('@int.*1.*@', $this->commandTester->getDisplay()); self::assertRegExp('@array.*1.*@', $this->commandTester->getDisplay());