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());