Skip to content

Commit

Permalink
Merge pull request #3706 from dmaicher/cmd-exit-code
Browse files Browse the repository at this point in the history
add missing exit codes to ensure Symfony 5 compatibility
  • Loading branch information
Ocramius authored Oct 28, 2019
2 parents ce401dd + 2f55925 commit d82b6aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -133,6 +133,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

return null;
return 0;
}
}
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$output->write(Dumper::dump($resultSet, (int) $depth));

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit d82b6aa

Please sign in to comment.