From 7634bb3182086b29aa8022d77f909280f0514f47 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Sun, 27 Oct 2019 20:28:56 +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 0e815663786..9c98b8f5b75 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $fileNames = $input->getArgument('file'); if ($fileNames === null) { - return null; + return 0; } foreach ((array) $fileNames as $fileName) { @@ -124,6 +124,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 8361219ad08..8590ba52979 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php @@ -64,5 +64,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 a85efd0a88c..857686d10f7 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() { $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());