-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Command simplification and deprecations #59564
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
Conversation
this is not true. Removing the parent constructor would require first deprecating calling it (even without a name), so that the code is ready for the removal. And making the parent constructor call mandatory in 6.4 LTS and deprecated in 7.3 would make it harder for the ecosystem to support both versions at once (which might encourage them to drop support for our LTS version before its EOL, which is bad for our communication about the LTS). However, I'm not sure encouraging to not call the parent constructor is the right solution. |
61c3d4a
to
a7024e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the $name
parameter from the constructor seems to be an unnecessary breaking change.
Damn! @stof you're right, I removed that sentence from the PR description. It's hard to deprecate since there is no way to know if the constructor was either called or there is no construct at all in the subclass. Let's revert that part, thanks! |
a7024e6
to
f61c319
Compare
Update! removed deprecation about passing the command name through the constructor. However, we can update the documentation to remove the |
I'll split this PR into two, so we can discuss both topics separately |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
moving the deprecation to a separate PR: #59565, and closing the other proposal for now, as it doesn't seem worthwhile at this point |
2 goals in this PR, one feature and one deprecation.
The feature is about delaying the command initialization, making the
parent::__construct()
call unnecessary in regular/new-invokable commands extending fromCommand
class.Example:
Additionally, the static methods
Command::getDefaultName()
andCommand::getDefaultDescription()
are deprecated (see discussion #59473 (comment)). These methods are now obsolete becauseAsCommand::name
andAsCommand::description
are configured directly in the service tag. These methods were mainly intended for framework/DI purposes, making it clearer for end users seeking to set the command name.