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
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[Console] Invokable command deprecations
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Issues | -
| License | MIT
I believe we missed the last commit during the squash and merge of symfony#59340. It has been applied here, along with the UPGRADE entry.
Commits
-------
71d0be1 [Console] Invokable command deprecations
if (null !== $statusCode && !\is_int($statusCode)) {
50
-
// throw new LogicException(\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)));
51
-
trigger_deprecation('symfony/console', '7.3', \sprintf('Returning a non-integer value from the command "%s" is deprecated and will throw an exception in PHP 8.0.', $this->command->getName()));
51
+
if ($this->triggerDeprecations) {
52
+
trigger_deprecation('symfony/console', '7.3', \sprintf('Returning a non-integer value from the command "%s" is deprecated and will throw an exception in PHP 8.0.', $this->command->getName()));
52
53
53
-
return0;
54
+
return0;
55
+
}
56
+
57
+
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)));
54
58
}
55
59
56
60
return$statusCode ?? 0;
@@ -92,10 +96,13 @@ private function getParameters(InputInterface $input, OutputInterface $output):
92
96
$type = $parameter->getType();
93
97
94
98
if (!$typeinstanceof \ReflectionNamedType) {
95
-
// throw new LogicException(\sprintf('The parameter "$%s" must have a named type. Untyped, Union or Intersection types are not supported.', $parameter->getName()));
96
-
trigger_deprecation('symfony/console', '7.3', \sprintf('Omitting the type declaration for the parameter "$%s" is deprecated and will throw an exception in PHP 8.0.', $parameter->getName()));
99
+
if ($this->triggerDeprecations) {
100
+
trigger_deprecation('symfony/console', '7.3', \sprintf('Omitting the type declaration for the parameter "$%s" is deprecated and will throw an exception in PHP 8.0.', $parameter->getName()));
97
101
98
-
continue;
102
+
continue;
103
+
}
104
+
105
+
thrownewLogicException(\sprintf('The parameter "$%s" must have a named type. Untyped, Union or Intersection types are not supported.', $parameter->getName()));
0 commit comments