From 739d19521e0b1611a9c3ae4a7b3ff231f415fb28 Mon Sep 17 00:00:00 2001 From: djordy Date: Fri, 15 Nov 2024 14:53:09 +0100 Subject: [PATCH 1/2] refactor: make DumpCommand final --- UPGRADE-5.0.md | 4 +++- src/Command/DumpCommand.php | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index d76b0ec65..84aed28ba 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -71,4 +71,6 @@ Future proofing for potential future changes and keeping it consistent with `des ```diff - public function supports(array $types): bool; + public function supports(array $types, array $context = []): bool; -``` \ No newline at end of file +``` + +## BC BREAK: `Nelmio\ApiDocBundle\Command` has been made final \ No newline at end of file diff --git a/src/Command/DumpCommand.php b/src/Command/DumpCommand.php index b9eada346..66dccb48b 100644 --- a/src/Command/DumpCommand.php +++ b/src/Command/DumpCommand.php @@ -18,10 +18,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -/** - * @final - */ -class DumpCommand extends Command +final class DumpCommand extends Command { private RenderOpenApi $renderOpenApi; From 0c47cd0e1213836d2f0eb03589d9424144d943e3 Mon Sep 17 00:00:00 2001 From: djordy Date: Fri, 15 Nov 2024 14:56:15 +0100 Subject: [PATCH 2/2] refactor: make PropertyDescribers final --- UPGRADE-5.0.md | 12 +++++++++++- src/PropertyDescriber/ArrayPropertyDescriber.php | 2 +- src/PropertyDescriber/BooleanPropertyDescriber.php | 2 +- src/PropertyDescriber/CompoundPropertyDescriber.php | 2 +- src/PropertyDescriber/DateTimePropertyDescriber.php | 2 +- src/PropertyDescriber/FloatPropertyDescriber.php | 2 +- src/PropertyDescriber/IntegerPropertyDescriber.php | 2 +- src/PropertyDescriber/ObjectPropertyDescriber.php | 2 +- src/PropertyDescriber/StringPropertyDescriber.php | 2 +- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 84aed28ba..b3a7de8af 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -73,4 +73,14 @@ Future proofing for potential future changes and keeping it consistent with `des + public function supports(array $types, array $context = []): bool; ``` -## BC BREAK: `Nelmio\ApiDocBundle\Command` has been made final \ No newline at end of file +## BC BREAK: `Nelmio\ApiDocBundle\Command` has been made final + +## BC BREAK: Made classes implementing `Nelmio\ApiDocBundle\PropertyDescriber\PropertyDescriberInterface` final +`Nelmio\ApiDocBundle\PropertyDescriber\ArrayPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\BooleanPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\DateTimePropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\CompoundPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\FloatPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\IntegerPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\ObjectPropertyDescriber` +`Nelmio\ApiDocBundle\PropertyDescriber\StringPropertyDescriber` diff --git a/src/PropertyDescriber/ArrayPropertyDescriber.php b/src/PropertyDescriber/ArrayPropertyDescriber.php index 78f46e1d6..6dd5b5edc 100644 --- a/src/PropertyDescriber/ArrayPropertyDescriber.php +++ b/src/PropertyDescriber/ArrayPropertyDescriber.php @@ -17,7 +17,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface +final class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface { use ModelRegistryAwareTrait; use PropertyDescriberAwareTrait; diff --git a/src/PropertyDescriber/BooleanPropertyDescriber.php b/src/PropertyDescriber/BooleanPropertyDescriber.php index bc493e087..4ce2d96b5 100644 --- a/src/PropertyDescriber/BooleanPropertyDescriber.php +++ b/src/PropertyDescriber/BooleanPropertyDescriber.php @@ -14,7 +14,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class BooleanPropertyDescriber implements PropertyDescriberInterface +final class BooleanPropertyDescriber implements PropertyDescriberInterface { /** * @param array $context Context options for describing the property diff --git a/src/PropertyDescriber/CompoundPropertyDescriber.php b/src/PropertyDescriber/CompoundPropertyDescriber.php index 8cf5c4b54..1457f95bc 100644 --- a/src/PropertyDescriber/CompoundPropertyDescriber.php +++ b/src/PropertyDescriber/CompoundPropertyDescriber.php @@ -17,7 +17,7 @@ use OpenApi\Annotations as OA; use OpenApi\Generator; -class CompoundPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface +final class CompoundPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface, PropertyDescriberAwareInterface { use ModelRegistryAwareTrait; use PropertyDescriberAwareTrait; diff --git a/src/PropertyDescriber/DateTimePropertyDescriber.php b/src/PropertyDescriber/DateTimePropertyDescriber.php index 50ade7408..d50ae84dd 100644 --- a/src/PropertyDescriber/DateTimePropertyDescriber.php +++ b/src/PropertyDescriber/DateTimePropertyDescriber.php @@ -14,7 +14,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class DateTimePropertyDescriber implements PropertyDescriberInterface +final class DateTimePropertyDescriber implements PropertyDescriberInterface { /** * @param array $context Context options for describing the property diff --git a/src/PropertyDescriber/FloatPropertyDescriber.php b/src/PropertyDescriber/FloatPropertyDescriber.php index 7dc29cf1d..0ce1fbf39 100644 --- a/src/PropertyDescriber/FloatPropertyDescriber.php +++ b/src/PropertyDescriber/FloatPropertyDescriber.php @@ -14,7 +14,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class FloatPropertyDescriber implements PropertyDescriberInterface +final class FloatPropertyDescriber implements PropertyDescriberInterface { /** * @param array $context Context options for describing the property diff --git a/src/PropertyDescriber/IntegerPropertyDescriber.php b/src/PropertyDescriber/IntegerPropertyDescriber.php index 4d20443b9..1a57482d8 100644 --- a/src/PropertyDescriber/IntegerPropertyDescriber.php +++ b/src/PropertyDescriber/IntegerPropertyDescriber.php @@ -14,7 +14,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class IntegerPropertyDescriber implements PropertyDescriberInterface +final class IntegerPropertyDescriber implements PropertyDescriberInterface { /** * @param array $context Context options for describing the property diff --git a/src/PropertyDescriber/ObjectPropertyDescriber.php b/src/PropertyDescriber/ObjectPropertyDescriber.php index 2b2084415..1c3a3ad8b 100644 --- a/src/PropertyDescriber/ObjectPropertyDescriber.php +++ b/src/PropertyDescriber/ObjectPropertyDescriber.php @@ -18,7 +18,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface +final class ObjectPropertyDescriber implements PropertyDescriberInterface, ModelRegistryAwareInterface { use ModelRegistryAwareTrait; diff --git a/src/PropertyDescriber/StringPropertyDescriber.php b/src/PropertyDescriber/StringPropertyDescriber.php index 73841efff..0ac285392 100644 --- a/src/PropertyDescriber/StringPropertyDescriber.php +++ b/src/PropertyDescriber/StringPropertyDescriber.php @@ -14,7 +14,7 @@ use OpenApi\Annotations as OA; use Symfony\Component\PropertyInfo\Type; -class StringPropertyDescriber implements PropertyDescriberInterface +final class StringPropertyDescriber implements PropertyDescriberInterface { /** * @param array $context Context options for describing the property