core icon indicating copy to clipboard operation
core copied to clipboard

use AsCommand to

Open tacman opened this issue 3 years ago • 1 comments

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.

tacman avatar Jun 01 '22 11:06 tacman

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.

KDederichs avatar Jun 19 '22 06:06 KDederichs