From a4b29ea0105adab8f087d2f7c608f7d174c0b9fd Mon Sep 17 00:00:00 2001 From: DjordyKoert Date: Tue, 2 Jan 2024 17:39:48 +0100 Subject: [PATCH] fix typed properties --- Annotation/Model.php | 8 ++++---- Annotation/Security.php | 2 +- Model/Model.php | 11 ++++++++--- ModelDescriber/ObjectModelDescriber.php | 2 +- Util/ControllerReflector.php | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Annotation/Model.php b/Annotation/Model.php index 7143cdf7b..7f472d238 100644 --- a/Annotation/Model.php +++ b/Annotation/Model.php @@ -36,14 +36,14 @@ final class Model extends Attachable public string $type; /** - * @var string[] + * @var string[]|null */ - public array $groups; + public ?array $groups; /** - * @var mixed[] + * @var mixed[]|null */ - public array $options; + public ?array $options; /** * @var array diff --git a/Annotation/Security.php b/Annotation/Security.php index c6a4b8716..99b07debe 100644 --- a/Annotation/Security.php +++ b/Annotation/Security.php @@ -26,7 +26,7 @@ class Security extends AbstractAnnotation public static $_required = ['name']; - public string $name; + public ?string $name; /** * @var string[] diff --git a/Model/Model.php b/Model/Model.php index c9464640d..865a4e701 100644 --- a/Model/Model.php +++ b/Model/Model.php @@ -17,9 +17,14 @@ final class Model { private Type $type; - - private array $options; - private array $serializationContext; + /** + * @var mixed[]|null + */ + private ?array $options; + /** + * @var array|null + */ + private ?array $serializationContext; /** * @param string[]|null $groups diff --git a/ModelDescriber/ObjectModelDescriber.php b/ModelDescriber/ObjectModelDescriber.php index c28e6131e..2573ae25b 100644 --- a/ModelDescriber/ObjectModelDescriber.php +++ b/ModelDescriber/ObjectModelDescriber.php @@ -35,7 +35,7 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar private ClassMetadataFactoryInterface $classMetadataFactory; private ?Reader $doctrineReader; /** @var PropertyDescriberInterface[] */ - private array $propertyDescribers; + private iterable $propertyDescribers; /** @var string[] */ private array $mediaTypes; private ?NameConverterInterface $nameConverter; diff --git a/Util/ControllerReflector.php b/Util/ControllerReflector.php index 64bfe56cd..fc351dc73 100644 --- a/Util/ControllerReflector.php +++ b/Util/ControllerReflector.php @@ -22,7 +22,7 @@ class ControllerReflector { private ContainerInterface $container; - private ControllerNameParser $controllerNameParser; + private ?ControllerNameParser $controllerNameParser = null; private array $controllers = [];