Skip to content

[Console] Deprecate returning a non-int value from a \Closure function set via Command::setCode() #60076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2025

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Mar 28, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? yes
Issues -
License MIT

This adds a missing log entry about a deprecation introduced here, and also deprecates returning a null value for \Closure code (which was allowed before) and throwing a \TypeError for the new invokable command, making this consistent with the Command::execute(): int method.

@yceruto yceruto requested a review from chalasr as a code owner March 28, 2025 13:36
@carsonbot carsonbot added this to the 7.3 milestone Mar 28, 2025
@yceruto yceruto changed the title Deprecate returning a non-int value from a \Closure function set via Command::setCode() [Console] Deprecate returning a non-int value from a \Closure function set via Command::setCode() Mar 28, 2025
@yceruto yceruto force-pushed the command_return_type branch 2 times, most recently from cedfb80 to afc81af Compare March 28, 2025 13:53
@carsonbot carsonbot changed the title [Console] Deprecate returning a non-int value from a \Closure function set via Command::setCode() Deprecate returning a non-int value from a \Closure function set via Command::setCode() Mar 28, 2025
@carsonbot carsonbot changed the title Deprecate returning a non-int value from a \Closure function set via Command::setCode() [Console] Deprecate returning a non-int value from a \Closure function set via Command::setCode() Mar 28, 2025
@yceruto yceruto force-pushed the command_return_type branch from afc81af to e0ab58a Compare March 29, 2025 04:01
@fabpot
Copy link
Member

fabpot commented Mar 29, 2025

Thank you @yceruto.

@fabpot fabpot merged commit f6b63a2 into symfony:7.3 Mar 29, 2025
11 checks passed
@yceruto yceruto deleted the command_return_type branch March 29, 2025 13:34
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants