[Console] Throw a TypeError for non-int return values on calling Command::execute()
This commit is contained in:
parent
95ebca5213
commit
b3a3b0c235
@ -10,6 +10,7 @@ CHANGELOG
|
|||||||
* removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()`
|
* removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()`
|
||||||
* removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()`
|
* removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()`
|
||||||
* removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()`
|
* removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()`
|
||||||
|
* removed support for returning `null` from `Command::execute()`, return `0` instead
|
||||||
* `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument
|
* `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument
|
||||||
* `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface`
|
* `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface`
|
||||||
for its `dispatcher` argument
|
for its `dispatcher` argument
|
||||||
|
@ -255,7 +255,7 @@ class Command
|
|||||||
$statusCode = $this->execute($input, $output);
|
$statusCode = $this->execute($input, $output);
|
||||||
|
|
||||||
if (!\is_int($statusCode)) {
|
if (!\is_int($statusCode)) {
|
||||||
@trigger_error(sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', \get_class($this), \gettype($statusCode)), E_USER_DEPRECATED);
|
throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, %s returned.', \get_class($this), \gettype($statusCode)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user