core
core copied to clipboard
fix: deprecated `UpgradeApiResourceCommand::$defaultName`
| Q | A |
|---|---|
| Branch? | 2.7 |
| Tickets | - |
| License | MIT |
| Doc PR | - |
Fixes:
- 1x: Since symfony/console 6.1: Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "Symfony\Component\Console\Attribute\AsCommand" attribute to the "ApiPlatform\Core\Bridge\Symfony\Bundle\Command\UpgradeApiResourceCommand" class instead.
I think you should use the getDefaultName method, like this PR: https://github.com/api-platform/core/pull/4795
As discussed this way is more future-proof and inline with what has been done in other community bundles. Opened #4889 to use it across the board