Skip to content

[12.x] Remove call to deprecated getDefaultDescription method #55990

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

jnoordsij
Copy link
Contributor

@jnoordsij jnoordsij commented Jun 11, 2025

The getDefaultDescription method on the (Symfony) Command class has been deprecated as of v7.3, see symfony/symfony#59565. This call was introduced in #45117, apparently to serve as a fallback for when no description is set in the Laravel Command child class implementation.

However, given that in the Symfony class this call is already part of the constructor in 7.2 (see https://github.com/symfony/symfony/blob/ac794a799f5eda52a67e099d6a2752574b86833f/src/Symfony/Component/Console/Command/Command.php#L100), the call here looks useless to me. (edit: it has been around since 5.3 even; see https://github.com/symfony/symfony/blob/a57252fb11b4cd856476aa4e4dd359404d3537fb/src/Symfony/Component/Console/Command/Command.php#L120).

To prevent this call from triggering deprecation messages (like the one forcefully suppressed in #55888), I therefore propose simply removing it altogether.

Use cases:

  • commands where the user implementing does not provide a description property value
  • commands where the user opts to use the AsCommand attribute from Symfony to provide command metadata

@jnoordsij
Copy link
Contributor Author

Side note: the workaround introduced in af52339 can probably be reverted after this fix.

@jnoordsij jnoordsij force-pushed the remove-deprecated-getdefaultdescription-call branch from 3487558 to f21b2db Compare June 11, 2025 16:36
@taylorotwell taylorotwell merged commit a55ab49 into laravel:12.x Jun 11, 2025
60 checks passed
@jnoordsij jnoordsij deleted the remove-deprecated-getdefaultdescription-call branch June 11, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants