From fc72dff03c5a6d78609dbe18cf2c7e11a1657d46 Mon Sep 17 00:00:00 2001 From: Kai Dederichs Date: Mon, 27 Jun 2022 14:37:45 +0200 Subject: [PATCH 1/2] fix: Remove $defaultCommand deprecation (#4795) * Overwrite getDefaultName to remove deprecation and preserve BC * Remove comment --- src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php | 7 +++++-- src/Bridge/Symfony/Bundle/Command/OpenApiCommand.php | 7 +++++-- src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php | 7 +++++-- src/JsonSchema/Command/JsonSchemaGenerateCommand.php | 7 +++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php b/src/Bridge/Symfony/Bundle/Command/GraphQlExportCommand.php index acdfa39fde6..94b959a01c3 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,9 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } + + 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..98e5b93c961 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,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + 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..f6134ca2901 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,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + 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..c2bb5db782f 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,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } + + public static function getDefaultName(): string + { + return 'api:json-schema:generate'; + } } From a71da4445effbec8df00cda4355aeb25b646b170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Nork=C5=ABnas?= Date: Fri, 1 Jul 2022 12:52:40 +0300 Subject: [PATCH 2/2] Fix `PropertyHelperTrait::getDoctrineFieldType` typehint Persistence metadata only returns null or string. --- src/Bridge/Doctrine/Common/PropertyHelperTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bridge/Doctrine/Common/PropertyHelperTrait.php b/src/Bridge/Doctrine/Common/PropertyHelperTrait.php index 4b1b5d4f234..db4721ea49f 100644 --- a/src/Bridge/Doctrine/Common/PropertyHelperTrait.php +++ b/src/Bridge/Doctrine/Common/PropertyHelperTrait.php @@ -128,7 +128,7 @@ protected function splitPropertyParts(string $property/* , string $resourceClass /** * Gets the Doctrine Type of a given property/resourceClass. * - * @return Type|string|null + * @return string|null */ protected function getDoctrineFieldType(string $property, string $resourceClass) {