You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (null !== $statusCode && !\is_int($statusCode)) {
52
+
if (!\is_int($statusCode)) {
53
53
if ($this->triggerDeprecations) {
54
54
trigger_deprecation('symfony/console', '7.3', \sprintf('Returning a non-integer value from the command "%s" is deprecated and will throw an exception in Symfony 8.0.', $this->command->getName()));
55
55
56
56
return0;
57
57
}
58
58
59
-
thrownewLogicException(\sprintf('The command "%s" must return either void or an integer value in the "%s" method, but "%s" was returned.', $this->command->getName(), $this->reflection->getName(), get_debug_type($statusCode)));
59
+
thrownew\TypeError(\sprintf('The command "%s" must return an integer value in the "%s" method, but "%s" was returned.', $this->command->getName(), $this->reflection->getName(), get_debug_type($statusCode)));
60
60
}
61
61
62
-
return$statusCode ?? 0;
62
+
return$statusCode;
63
63
}
64
64
65
65
/**
@@ -85,6 +85,8 @@ private function getClosure(callable $code): \Closure
85
85
return$code(...);
86
86
}
87
87
88
+
$this->triggerDeprecations = true;
89
+
88
90
if (null !== (new \ReflectionFunction($code))->getClosureThis()) {
$this->expectDeprecation('Since symfony/console 7.3: Returning a non-integer value from the command "foo" is deprecated and will throw an exception in Symfony 8.0.');
0 commit comments