diff --git a/src/ApiDocGenerator.php b/src/ApiDocGenerator.php index 61d805cf3..ee100affc 100644 --- a/src/ApiDocGenerator.php +++ b/src/ApiDocGenerator.php @@ -37,11 +37,9 @@ final class ApiDocGenerator /** @var iterable|ModelDescriberInterface[] */ private $modelDescribers; - /** @var CacheItemPoolInterface|null */ - private $cacheItemPool; + private ?CacheItemPoolInterface $cacheItemPool; - /** @var string */ - private $cacheItemId; + private string $cacheItemId; /** @var string[] */ private $alternativeNames = []; @@ -53,8 +51,7 @@ final class ApiDocGenerator */ private $openApiVersion; - /** @var Generator */ - private $generator; + private Generator $generator; /** * @param DescriberInterface[]|iterable $describers diff --git a/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php b/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php index 49a923cc3..39db78e5e 100644 --- a/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php +++ b/src/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php @@ -27,20 +27,14 @@ class SymfonyConstraintAnnotationReader { use SetsContextTrait; - /** - * @var Reader|null - */ - private $annotationsReader; + private ?Reader $annotationsReader; /** * @var OA\Schema */ private $schema; - /** - * @var bool - */ - private $useValidationGroups; + private bool $useValidationGroups; public function __construct(?Reader $annotationsReader, bool $useValidationGroups = false) { diff --git a/src/ModelDescriber/ObjectModelDescriber.php b/src/ModelDescriber/ObjectModelDescriber.php index eac0370eb..f119bdef0 100644 --- a/src/ModelDescriber/ObjectModelDescriber.php +++ b/src/ModelDescriber/ObjectModelDescriber.php @@ -31,20 +31,16 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar use ModelRegistryAwareTrait; use ApplyOpenApiDiscriminatorTrait; - /** @var PropertyInfoExtractorInterface */ - private $propertyInfo; - /** @var ClassMetadataFactoryInterface|null */ - private $classMetadataFactory; - /** @var Reader|null */ - private $doctrineReader; + private PropertyInfoExtractorInterface $propertyInfo; + private ?ClassMetadataFactoryInterface $classMetadataFactory; + private ?Reader $doctrineReader; /** @var PropertyDescriberInterface|PropertyDescriberInterface[] */ private $propertyDescriber; /** @var string[] */ - private $mediaTypes; + private array $mediaTypes; /** @var (NameConverterInterface&AdvancedNameConverterInterface)|null */ - private $nameConverter; - /** @var bool */ - private $useValidationGroups; + private ?NameConverterInterface $nameConverter; + private bool $useValidationGroups; /** * @param PropertyDescriberInterface|PropertyDescriberInterface[] $propertyDescribers diff --git a/tests/Functional/Entity/VirtualProperty80.php b/tests/Functional/Entity/VirtualProperty80.php index 7616a1a08..fe54a6920 100644 --- a/tests/Functional/Entity/VirtualProperty80.php +++ b/tests/Functional/Entity/VirtualProperty80.php @@ -35,10 +35,7 @@ class VirtualProperty80 */ private $id; - /** - * @var User - */ - private $user; + private User $user; /** * @Serializer\Accessor(getter="getFoo", setter="setFoo") diff --git a/tests/Functional/Entity/VirtualProperty81.php b/tests/Functional/Entity/VirtualProperty81.php index 7dbbf5649..3d51a2a31 100644 --- a/tests/Functional/Entity/VirtualProperty81.php +++ b/tests/Functional/Entity/VirtualProperty81.php @@ -31,10 +31,7 @@ class VirtualProperty81 #[Serializer\Expose] private $id; - /** - * @var User - */ - private $user; + private User $user; #[Serializer\Accessor(getter: 'getFoo', setter: 'setFoo')] #[Serializer\Type('string')] diff --git a/tests/Functional/ModelDescriber/NameConverter.php b/tests/Functional/ModelDescriber/NameConverter.php index 55502c579..cb42c59f3 100644 --- a/tests/Functional/ModelDescriber/NameConverter.php +++ b/tests/Functional/ModelDescriber/NameConverter.php @@ -18,10 +18,7 @@ class NameConverter implements AdvancedNameConverterInterface { - /** - * @var MetadataAwareNameConverter - */ - private $inner; + private MetadataAwareNameConverter $inner; public function __construct(MetadataAwareNameConverter $inner) {