core
core copied to clipboard
use AsCommand to
Description
As of Symfony 6.1, Symfony\Component\Console\Attribute\AsCommand attribute is required.
Example
bin/console api
2022-06-01T07:36:06-04:00 [info] User Deprecated: 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\JsonSchema\Command\JsonSchemaGenerateCommand" class instead.
2022-06-01T07:36:06-04:00 [info] User Deprecated: 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\OpenApiCommand" class instead.
2022-06-01T07:36:06-04:00 [info] User Deprecated: 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\SwaggerCommand" class instead.
The fix is pretty simple, and I'm happy to do it, but am wondering which branch to put it in.
If you consider it also needs to keep working with older SF versions I don't think it's that simple cause you'd need to switch between the Systems depending on the version.