Problem/Motivation
Documentation for Symfony\Component\Console\Command\Command::execute() indicates that the method should return an integer, specifically 0 on success or an error code.
Drupal\Core\Command\DbImportCommand::execute()
Drupal\Core\Command\DbDumpCommand::execute()
and
Drupal\Tests\system\Kernel\Scripts\DbCommandBaseTester::execute()
do not return anything at all, but should return an integer.
Additionally, in Symfony 4.4, this lack of return value will trigger a deprecation warning.
Proposed resolution
Add the return value to these methods.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
mikelutzSet to major, because this should be in prior to branching 9.0.x
Comment #3
mikelutzComment #4
mikelutzComment #5
volegerAre those ones ok?
Comment #6
mikelutzThey probably should be fixed if they don't return an integer, though they did not trigger an error in the test run.
Comment #7
larowlanYes, lets fix all of them in one go - thanks!
Comment #8
wim leersUpdated those too. Thanks, @voleger!
Since this is just me repeating a trivial pattern, and I'd have RTBC'd #2, I think in this case self-RTBC'ing is acceptable.
(Especially because this blocks #2976394: Allow Symfony 4.4 to be installed in Drupal 8, which is super important for Drupal 9.)
Comment #9
voleger+1 for RTBC
Comment #11
catchCommitted 1e6ffcb and pushed to 8.8.x. Thanks!