diff --git a/config/services.xml b/config/services.xml index 55db81ba3..df284c903 100644 --- a/config/services.xml +++ b/config/services.xml @@ -163,57 +163,57 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/ModelDescriber/ObjectModelDescriber.php b/src/ModelDescriber/ObjectModelDescriber.php index c92ae770b..04ff0cbc8 100644 --- a/src/ModelDescriber/ObjectModelDescriber.php +++ b/src/ModelDescriber/ObjectModelDescriber.php @@ -18,7 +18,7 @@ use Nelmio\ApiDocBundle\ModelDescriber\Annotations\AnnotationsReader; use Nelmio\ApiDocBundle\OpenApiPhp\Util; use Nelmio\ApiDocBundle\PropertyDescriber\PropertyDescriberInterface; -use Nelmio\ApiDocBundle\SchemaDescriber\SchemaDescriberInterface; +use Nelmio\ApiDocBundle\TypeDescriber\TypeDescriberInterface; use OpenApi\Annotations as OA; use OpenApi\Generator; use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; @@ -35,7 +35,7 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar private PropertyInfoExtractorInterface $propertyInfo; private ?ClassMetadataFactoryInterface $classMetadataFactory; private ?Reader $doctrineReader; - /** @var PropertyDescriberInterface|PropertyDescriberInterface[]|SchemaDescriberInterface */ + /** @var PropertyDescriberInterface|PropertyDescriberInterface[]|TypeDescriberInterface */ private $propertyDescriber; /** @var string[] */ private array $mediaTypes; @@ -44,9 +44,9 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar private bool $useValidationGroups; /** - * @param PropertyDescriberInterface|PropertyDescriberInterface[]|SchemaDescriberInterface $propertyDescribers - * @param (NameConverterInterface&AdvancedNameConverterInterface)|null $nameConverter - * @param string[] $mediaTypes + * @param PropertyDescriberInterface|PropertyDescriberInterface[]|TypeDescriberInterface $propertyDescribers + * @param (NameConverterInterface&AdvancedNameConverterInterface)|null $nameConverter + * @param string[] $mediaTypes */ public function __construct( PropertyInfoExtractorInterface $propertyInfo, @@ -60,7 +60,7 @@ public function __construct( if (is_iterable($propertyDescribers)) { trigger_deprecation('nelmio/api-doc-bundle', '4.17', 'Passing an array of PropertyDescriberInterface to %s() is deprecated. Pass a single PropertyDescriberInterface instead.', __METHOD__); } else { - if (!$propertyDescribers instanceof PropertyDescriberInterface && !$propertyDescribers instanceof SchemaDescriberInterface) { + if (!$propertyDescribers instanceof PropertyDescriberInterface && !$propertyDescribers instanceof TypeDescriberInterface) { throw new \InvalidArgumentException(sprintf('Argument 3 passed to %s() must be an array of %s or a single %s.', __METHOD__, PropertyDescriberInterface::class, PropertyDescriberInterface::class)); } } @@ -179,7 +179,7 @@ public function describe(Model $model, OA\Schema $schema) /* * @experimental */ - if ($this->propertyDescriber instanceof SchemaDescriberInterface) { + if ($this->propertyDescriber instanceof TypeDescriberInterface) { if (false === method_exists($this->propertyInfo, 'getType')) { throw new \RuntimeException('The PropertyInfo component is missing the "getType" method. Are you running on version 7.1?'); } diff --git a/src/SchemaDescriber/BoolDescriber.php b/src/TypeDescriber/BoolDescriber.php similarity index 80% rename from src/SchemaDescriber/BoolDescriber.php rename to src/TypeDescriber/BoolDescriber.php index f62c22422..2646928ec 100644 --- a/src/SchemaDescriber/BoolDescriber.php +++ b/src/TypeDescriber/BoolDescriber.php @@ -9,18 +9,18 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class BoolDescriber implements SchemaDescriberInterface +final class BoolDescriber implements TypeDescriberInterface { public function describe(Type $type, Schema $schema, array $context = []): void { diff --git a/src/SchemaDescriber/ChainDescriber.php b/src/TypeDescriber/ChainDescriber.php similarity index 80% rename from src/SchemaDescriber/ChainDescriber.php rename to src/TypeDescriber/ChainDescriber.php index 394d178c4..56ea55ee1 100644 --- a/src/SchemaDescriber/ChainDescriber.php +++ b/src/TypeDescriber/ChainDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareInterface; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareTrait; @@ -17,19 +17,19 @@ use Symfony\Component\TypeInfo\Type; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class ChainDescriber implements SchemaDescriberInterface, ModelRegistryAwareInterface +final class ChainDescriber implements TypeDescriberInterface, ModelRegistryAwareInterface { use ModelRegistryAwareTrait; - /** @var iterable */ + /** @var iterable */ private iterable $describers; /** - * @param iterable $describers + * @param iterable $describers */ public function __construct( iterable $describers @@ -49,7 +49,7 @@ public function describe(Type $type, Schema $schema, array $context = []): void $describer->setModelRegistry($this->modelRegistry); } - if ($describer instanceof SchemaDescriberAwareInterface) { + if ($describer instanceof TypeDescriberAwareInterface) { $describer->setDescriber($this); } diff --git a/src/SchemaDescriber/DictionaryDescriber.php b/src/TypeDescriber/DictionaryDescriber.php similarity index 83% rename from src/SchemaDescriber/DictionaryDescriber.php rename to src/TypeDescriber/DictionaryDescriber.php index c3bcf9ccf..24c6f2ac3 100644 --- a/src/SchemaDescriber/DictionaryDescriber.php +++ b/src/TypeDescriber/DictionaryDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\OpenApiPhp\Util; use OpenApi\Annotations as OA; @@ -19,11 +19,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class DictionaryDescriber implements SchemaDescriberInterface, SchemaDescriberAwareInterface +final class DictionaryDescriber implements TypeDescriberInterface, TypeDescriberAwareInterface { use SchemaDescriberAwareTrait; diff --git a/src/SchemaDescriber/FloatDescriber.php b/src/TypeDescriber/FloatDescriber.php similarity index 80% rename from src/SchemaDescriber/FloatDescriber.php rename to src/TypeDescriber/FloatDescriber.php index 2f37f5c9f..c2dc6a0ef 100644 --- a/src/SchemaDescriber/FloatDescriber.php +++ b/src/TypeDescriber/FloatDescriber.php @@ -9,18 +9,18 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class FloatDescriber implements SchemaDescriberInterface +final class FloatDescriber implements TypeDescriberInterface { public function describe(Type $type, Schema $schema, array $context = []): void { diff --git a/src/SchemaDescriber/IntegerDescriber.php b/src/TypeDescriber/IntegerDescriber.php similarity index 79% rename from src/SchemaDescriber/IntegerDescriber.php rename to src/TypeDescriber/IntegerDescriber.php index 6241df3b8..ae297a318 100644 --- a/src/SchemaDescriber/IntegerDescriber.php +++ b/src/TypeDescriber/IntegerDescriber.php @@ -9,18 +9,18 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class IntegerDescriber implements SchemaDescriberInterface +final class IntegerDescriber implements TypeDescriberInterface { public function describe(Type $type, Schema $schema, array $context = []): void { diff --git a/src/SchemaDescriber/IntersectionDescriber.php b/src/TypeDescriber/IntersectionDescriber.php similarity index 88% rename from src/SchemaDescriber/IntersectionDescriber.php rename to src/TypeDescriber/IntersectionDescriber.php index f5104224b..052ee82ed 100644 --- a/src/SchemaDescriber/IntersectionDescriber.php +++ b/src/TypeDescriber/IntersectionDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\OpenApiPhp\Util; use OpenApi\Annotations\Schema; @@ -19,11 +19,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class IntersectionDescriber implements SchemaDescriberInterface, SchemaDescriberAwareInterface +final class IntersectionDescriber implements TypeDescriberInterface, TypeDescriberAwareInterface { use SchemaDescriberAwareTrait; diff --git a/src/SchemaDescriber/ListDescriber.php b/src/TypeDescriber/ListDescriber.php similarity index 83% rename from src/SchemaDescriber/ListDescriber.php rename to src/TypeDescriber/ListDescriber.php index 5c1b35bcf..e262fd3c2 100644 --- a/src/SchemaDescriber/ListDescriber.php +++ b/src/TypeDescriber/ListDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\OpenApiPhp\Util; use OpenApi\Annotations as OA; @@ -19,11 +19,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class ListDescriber implements SchemaDescriberInterface, SchemaDescriberAwareInterface +final class ListDescriber implements TypeDescriberInterface, TypeDescriberAwareInterface { use SchemaDescriberAwareTrait; diff --git a/src/SchemaDescriber/MixedDescriber.php b/src/TypeDescriber/MixedDescriber.php similarity index 80% rename from src/SchemaDescriber/MixedDescriber.php rename to src/TypeDescriber/MixedDescriber.php index 6c3860300..fe06f7a67 100644 --- a/src/SchemaDescriber/MixedDescriber.php +++ b/src/TypeDescriber/MixedDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use OpenApi\Generator; @@ -17,11 +17,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class MixedDescriber implements SchemaDescriberInterface +final class MixedDescriber implements TypeDescriberInterface { public function describe(Type $type, Schema $schema, array $context = []): void { diff --git a/src/SchemaDescriber/NullableDescriber.php b/src/TypeDescriber/NullableDescriber.php similarity index 76% rename from src/SchemaDescriber/NullableDescriber.php rename to src/TypeDescriber/NullableDescriber.php index 3b46ae981..a76fa72a5 100644 --- a/src/SchemaDescriber/NullableDescriber.php +++ b/src/TypeDescriber/NullableDescriber.php @@ -9,17 +9,17 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class NullableDescriber implements SchemaDescriberInterface, SchemaDescriberAwareInterface +final class NullableDescriber implements TypeDescriberInterface, TypeDescriberAwareInterface { use SchemaDescriberAwareTrait; diff --git a/src/SchemaDescriber/ObjectClassDescriber.php b/src/TypeDescriber/ObjectClassDescriber.php similarity index 88% rename from src/SchemaDescriber/ObjectClassDescriber.php rename to src/TypeDescriber/ObjectClassDescriber.php index de3b64f57..b709fe319 100644 --- a/src/SchemaDescriber/ObjectClassDescriber.php +++ b/src/TypeDescriber/ObjectClassDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareInterface; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareTrait; @@ -22,11 +22,11 @@ use Symfony\Component\Uid\AbstractUid; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class ObjectClassDescriber implements SchemaDescriberInterface, ModelRegistryAwareInterface +final class ObjectClassDescriber implements TypeDescriberInterface, ModelRegistryAwareInterface { use ModelRegistryAwareTrait; diff --git a/src/SchemaDescriber/ObjectDescriber.php b/src/TypeDescriber/ObjectDescriber.php similarity index 82% rename from src/SchemaDescriber/ObjectDescriber.php rename to src/TypeDescriber/ObjectDescriber.php index 193e03b0d..b0c8d83dc 100644 --- a/src/SchemaDescriber/ObjectDescriber.php +++ b/src/TypeDescriber/ObjectDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareInterface; use Nelmio\ApiDocBundle\Describer\ModelRegistryAwareTrait; @@ -19,11 +19,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class ObjectDescriber implements SchemaDescriberInterface, ModelRegistryAwareInterface +final class ObjectDescriber implements TypeDescriberInterface, ModelRegistryAwareInterface { use ModelRegistryAwareTrait; diff --git a/src/SchemaDescriber/SchemaDescriberAwareTrait.php b/src/TypeDescriber/SchemaDescriberAwareTrait.php similarity index 65% rename from src/SchemaDescriber/SchemaDescriberAwareTrait.php rename to src/TypeDescriber/SchemaDescriberAwareTrait.php index cf51b56ad..95031dc4e 100644 --- a/src/SchemaDescriber/SchemaDescriberAwareTrait.php +++ b/src/TypeDescriber/SchemaDescriberAwareTrait.php @@ -9,16 +9,16 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; /** * @experimental */ trait SchemaDescriberAwareTrait { - protected SchemaDescriberInterface $describer; + protected TypeDescriberInterface $describer; - public function setDescriber(SchemaDescriberInterface $describer): void + public function setDescriber(TypeDescriberInterface $describer): void { $this->describer = $describer; } diff --git a/src/SchemaDescriber/StringDescriber.php b/src/TypeDescriber/StringDescriber.php similarity index 80% rename from src/SchemaDescriber/StringDescriber.php rename to src/TypeDescriber/StringDescriber.php index e9cdf157c..9bc5a8799 100644 --- a/src/SchemaDescriber/StringDescriber.php +++ b/src/TypeDescriber/StringDescriber.php @@ -9,18 +9,18 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class StringDescriber implements SchemaDescriberInterface +final class StringDescriber implements TypeDescriberInterface { public function describe(Type $type, Schema $schema, array $context = []): void { diff --git a/src/SchemaDescriber/SchemaDescriberAwareInterface.php b/src/TypeDescriber/TypeDescriberAwareInterface.php similarity index 60% rename from src/SchemaDescriber/SchemaDescriberAwareInterface.php rename to src/TypeDescriber/TypeDescriberAwareInterface.php index beb7f8759..318cc29b3 100644 --- a/src/SchemaDescriber/SchemaDescriberAwareInterface.php +++ b/src/TypeDescriber/TypeDescriberAwareInterface.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; /** * @experimental */ -interface SchemaDescriberAwareInterface +interface TypeDescriberAwareInterface { - public function setDescriber(SchemaDescriberInterface $describer): void; + public function setDescriber(TypeDescriberInterface $describer): void; } diff --git a/src/SchemaDescriber/SchemaDescriberInterface.php b/src/TypeDescriber/TypeDescriberInterface.php similarity index 90% rename from src/SchemaDescriber/SchemaDescriberInterface.php rename to src/TypeDescriber/TypeDescriberInterface.php index 060fa9e9f..f2c824872 100644 --- a/src/SchemaDescriber/SchemaDescriberInterface.php +++ b/src/TypeDescriber/TypeDescriberInterface.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use OpenApi\Annotations\Schema; use Symfony\Component\TypeInfo\Type; @@ -19,7 +19,7 @@ * * @experimental */ -interface SchemaDescriberInterface +interface TypeDescriberInterface { /** * @param T $type diff --git a/src/SchemaDescriber/UnionDescriber.php b/src/TypeDescriber/UnionDescriber.php similarity index 89% rename from src/SchemaDescriber/UnionDescriber.php rename to src/TypeDescriber/UnionDescriber.php index f64cafafa..54c9d1b9b 100644 --- a/src/SchemaDescriber/UnionDescriber.php +++ b/src/TypeDescriber/UnionDescriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Nelmio\ApiDocBundle\SchemaDescriber; +namespace Nelmio\ApiDocBundle\TypeDescriber; use Nelmio\ApiDocBundle\OpenApiPhp\Util; use OpenApi\Annotations\Schema; @@ -19,11 +19,11 @@ use Symfony\Component\TypeInfo\TypeIdentifier; /** - * @implements SchemaDescriberInterface + * @implements TypeDescriberInterface * * @experimental */ -final class UnionDescriber implements SchemaDescriberInterface, SchemaDescriberAwareInterface +final class UnionDescriber implements TypeDescriberInterface, TypeDescriberAwareInterface { use SchemaDescriberAwareTrait;