Skip to content

Commit 7bf56fb

Browse files
jschaedlnicolas-grekas
authored andcommitted
[Console] Command::execute() should always return int - deprecate returning null
- added deprecation message for non-int return value in Command::execute() - fixed all core commands to return proper int values - added proper return type-hint to Command::execute() method in all core Commands
1 parent 8290161 commit 7bf56fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Command/DebugCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
111111

112112
switch ($input->getOption('format')) {
113113
case 'text':
114-
return $name ? $this->displayPathsText($io, $name) : $this->displayGeneralText($io, $filter);
114+
$name ? $this->displayPathsText($io, $name) : $this->displayGeneralText($io, $filter);
115+
break;
115116
case 'json':
116-
return $name ? $this->displayPathsJson($io, $name) : $this->displayGeneralJson($io, $filter);
117+
$name ? $this->displayPathsJson($io, $name) : $this->displayGeneralJson($io, $filter);
118+
break;
117119
default:
118120
throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $input->getOption('format')));
119121
}
122+
123+
return 0;
120124
}
121125

122126
private function displayPathsText(SymfonyStyle $io, string $name)

0 commit comments

Comments
 (0)