Skip to content

Commit

Permalink
minor #4570 Command::execute() should always return an integer (derra…
Browse files Browse the repository at this point in the history
…bus)

This PR was merged into the 2.15 branch.

Discussion
----------

Command::execute() should always return an integer

In Symfony 4.4, a deprecation error is triggered if `Command::execute()` does not return an integer, see symfony/symfony#33747. This PR adds the necessary `return` statements.

Commits
-------

ee758b1 Command::execute() should always return an integer.
  • Loading branch information
SpacePossum committed Oct 8, 2019
2 parents 5cf7e0a + ee758b1 commit d39b456
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Console/Command/DescribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ('@' === $name[0]) {
$this->describeSet($output, $name);

return null;
return 0;
}

$this->describeRule($output, $name);
Expand All @@ -126,6 +126,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
null === $alternative ? '' : ' Did you mean "'.$alternative.'"?'
));
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Command/ReadmeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,7 @@ static function (array $matches) {
$footer = str_replace('%download.url%', $downloadUrl, $footer);

$output->write($header."\n".$help."\n".$footer);

return 0;
}
}
2 changes: 2 additions & 0 deletions src/Console/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
rename($tempFilename, $localFilename);

$output->writeln(sprintf('<info>php-cs-fixer updated</info> (<comment>%s</comment>)', $remoteTag));

return 0;
}
}

0 comments on commit d39b456

Please sign in to comment.