From a58e022911ad93e2afec60ece73fea4cb166336a Mon Sep 17 00:00:00 2001 From: Kai Dederichs Date: Sun, 19 Jun 2022 12:45:47 +0200 Subject: [PATCH 1/2] Overwrite getDefaultName to remove deprecation and preserve BC --- .../Symfony/Bundle/Command/GraphQlExportCommand.php | 8 ++++++-- src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php | 8 ++++++-- src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php | 8 ++++++-- src/JsonSchema/Command/JsonSchemaGenerateCommand.php | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php b/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php index acdfa39fde6..fa0e24c7f0f 100644 --- a/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php @@ -30,8 +30,6 @@ */ class GraphQlExportCommand extends Command { - protected static $defaultName = 'api:graphql:export'; - private $schemaBuilder; public function __construct(SchemaBuilderInterface $schemaBuilder) @@ -79,4 +77,10 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + + // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped + public static function getDefaultName(): string + { + return 'api:graphql:export'; + } } diff --git a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php index 68314d55098..c353d9df762 100644 --- a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php @@ -29,8 +29,6 @@ */ final class OpenApiCommand extends Command { - protected static $defaultName = 'api:openapi:export'; - private $openApiFactory; private $normalizer; @@ -91,4 +89,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped + public static function getDefaultName(): string + { + return 'api:openapi:export'; + } } diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index 61198eaceb5..e80f597bc32 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -33,8 +33,6 @@ */ final class SwaggerCommand extends Command { - protected static $defaultName = 'api:swagger:export'; - private $normalizer; private $resourceNameCollectionFactory; private $apiTitle; @@ -109,4 +107,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped + public static function getDefaultName(): string + { + return 'api:swagger:export'; + } } diff --git a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php index 9be6a2c03d3..31152e306d8 100644 --- a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php +++ b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php @@ -31,8 +31,6 @@ */ final class JsonSchemaGenerateCommand extends Command { - protected static $defaultName = 'api:json-schema:generate'; - private $schemaFactory; private $formats; @@ -114,4 +112,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped + public static function getDefaultName(): string + { + return 'api:json-schema:generate'; + } } From 52f70adf3fa09b6b5186a40850e8059d0b0db290 Mon Sep 17 00:00:00 2001 From: Kai Dederichs Date: Sun, 19 Jun 2022 13:16:58 +0200 Subject: [PATCH 2/2] Remove comment --- src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php | 1 - src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php | 1 - src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php | 1 - src/JsonSchema/Command/JsonSchemaGenerateCommand.php | 1 - 4 files changed, 4 deletions(-) diff --git a/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php b/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php index fa0e24c7f0f..94b959a01c3 100644 --- a/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php @@ -78,7 +78,6 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } - // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped public static function getDefaultName(): string { return 'api:graphql:export'; diff --git a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php index c353d9df762..98e5b93c961 100644 --- a/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php @@ -90,7 +90,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped public static function getDefaultName(): string { return 'api:openapi:export'; diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index e80f597bc32..f6134ca2901 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -108,7 +108,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped public static function getDefaultName(): string { return 'api:swagger:export'; diff --git a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php index 31152e306d8..c2bb5db782f 100644 --- a/src/JsonSchema/Command/JsonSchemaGenerateCommand.php +++ b/src/JsonSchema/Command/JsonSchemaGenerateCommand.php @@ -113,7 +113,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - // Use AsCommand Attribute when SF 4.4 and PHP 7 gets dropped public static function getDefaultName(): string { return 'api:json-schema:generate';