From 1302b7ffccf1d022a3687ff3828df83a8b813f47 Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 10:55:04 +0300 Subject: [PATCH 01/10] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5592e2c5..1af2a500 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "symfony/serializer": "^5.0", + "symfony/serializer": "^5.0 || ^6.0", "elasticsearch/elasticsearch": "^7.0" }, "require-dev": { From 4bf42a453fcbb54d215163b8ea95b15cb8bf252c Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:40:03 +0300 Subject: [PATCH 02/10] Update OrderedSerializer --- src/Serializer/OrderedSerializer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Serializer/OrderedSerializer.php b/src/Serializer/OrderedSerializer.php index 9019e43e..7179069f 100644 --- a/src/Serializer/OrderedSerializer.php +++ b/src/Serializer/OrderedSerializer.php @@ -22,7 +22,7 @@ class OrderedSerializer extends Serializer /** * {@inheritdoc} */ - public function normalize($data, $format = null, array $context = []) + public function normalize(mixed $data, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { return parent::normalize( is_array($data) ? $this->order($data) : $data, @@ -34,7 +34,7 @@ public function normalize($data, $format = null, array $context = []) /** * {@inheritdoc} */ - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed { return parent::denormalize( is_array($data) ? $this->order($data) : $data, @@ -86,3 +86,4 @@ function ($value) { ); } } + From b1df2f99860caaf7d936110232acb2c425be5cd0 Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:40:38 +0300 Subject: [PATCH 03/10] Update CustomReferencedNormalizer.php --- src/Serializer/Normalizer/CustomReferencedNormalizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serializer/Normalizer/CustomReferencedNormalizer.php b/src/Serializer/Normalizer/CustomReferencedNormalizer.php index fd32a89b..d7a6bd9b 100644 --- a/src/Serializer/Normalizer/CustomReferencedNormalizer.php +++ b/src/Serializer/Normalizer/CustomReferencedNormalizer.php @@ -26,7 +26,7 @@ class CustomReferencedNormalizer extends CustomNormalizer /** * {@inheritdoc} */ - public function normalize($object, string $format = null, array $context = []) + public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { $object->setReferences($this->references); $data = parent::normalize($object, $format, $context); @@ -38,7 +38,7 @@ public function normalize($object, string $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, string $format = null): bool { return $data instanceof AbstractNormalizable; } From eb5adf3ba0e9c5fcc8ce14700d4ba29920afaeb2 Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:49:07 +0300 Subject: [PATCH 04/10] Update QueryEndpoint.php --- src/SearchEndpoint/QueryEndpoint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SearchEndpoint/QueryEndpoint.php b/src/SearchEndpoint/QueryEndpoint.php index b7626910..17d96c0c 100644 --- a/src/SearchEndpoint/QueryEndpoint.php +++ b/src/SearchEndpoint/QueryEndpoint.php @@ -39,7 +39,7 @@ class QueryEndpoint extends AbstractSearchEndpoint implements OrderedNormalizerI /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { if (!$this->filtersSet && $this->hasReference('filter_query')) { /** @var BuilderInterface $filter */ @@ -49,7 +49,7 @@ public function normalize(NormalizerInterface $normalizer, string $format = null } if (!$this->bool) { - return null; + return false; } return $this->bool->toArray(); From fd723f983c5f5cf779774a04e0faccf2b4295dea Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:50:36 +0300 Subject: [PATCH 05/10] Update AggregationsEndpoint.php --- src/SearchEndpoint/AggregationsEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchEndpoint/AggregationsEndpoint.php b/src/SearchEndpoint/AggregationsEndpoint.php index 3e035f43..a50a515b 100644 --- a/src/SearchEndpoint/AggregationsEndpoint.php +++ b/src/SearchEndpoint/AggregationsEndpoint.php @@ -27,7 +27,7 @@ class AggregationsEndpoint extends AbstractSearchEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { $output = []; if (count($this->getAll()) > 0) { From 485b5363bcf66b5f2065cf84313cefc3f66e7abe Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:50:56 +0300 Subject: [PATCH 06/10] Update HighlightEndpoint.php --- src/SearchEndpoint/HighlightEndpoint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SearchEndpoint/HighlightEndpoint.php b/src/SearchEndpoint/HighlightEndpoint.php index aa57b3d7..0549994e 100644 --- a/src/SearchEndpoint/HighlightEndpoint.php +++ b/src/SearchEndpoint/HighlightEndpoint.php @@ -37,13 +37,13 @@ class HighlightEndpoint extends AbstractSearchEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { if ($this->highlight) { return $this->highlight->toArray(); } - return null; + return false; } /** From e1f18820c434aa4440722dba254b362514eadd3e Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:51:14 +0300 Subject: [PATCH 07/10] Update InnerHitsEndpoint.php --- src/SearchEndpoint/InnerHitsEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchEndpoint/InnerHitsEndpoint.php b/src/SearchEndpoint/InnerHitsEndpoint.php index 8428bd88..58e782b2 100644 --- a/src/SearchEndpoint/InnerHitsEndpoint.php +++ b/src/SearchEndpoint/InnerHitsEndpoint.php @@ -27,7 +27,7 @@ class InnerHitsEndpoint extends AbstractSearchEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { $output = []; if (count($this->getAll()) > 0) { From 3bfcbd7d8693900820f037a0d67e077c725904a8 Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:51:35 +0300 Subject: [PATCH 08/10] Update PostFilterEndpoint.php --- src/SearchEndpoint/PostFilterEndpoint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SearchEndpoint/PostFilterEndpoint.php b/src/SearchEndpoint/PostFilterEndpoint.php index de3e263c..d0e9a09f 100644 --- a/src/SearchEndpoint/PostFilterEndpoint.php +++ b/src/SearchEndpoint/PostFilterEndpoint.php @@ -26,10 +26,10 @@ class PostFilterEndpoint extends QueryEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { if (!$this->getBool()) { - return null; + return false; } return $this->getBool()->toArray(); From e3e3034fcd8ee97a537ebfcb6eb7b54e32b1424e Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:51:58 +0300 Subject: [PATCH 09/10] Update SortEndpoint.php --- src/SearchEndpoint/SortEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchEndpoint/SortEndpoint.php b/src/SearchEndpoint/SortEndpoint.php index cd00bb2f..009de9d8 100644 --- a/src/SearchEndpoint/SortEndpoint.php +++ b/src/SearchEndpoint/SortEndpoint.php @@ -26,7 +26,7 @@ class SortEndpoint extends AbstractSearchEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { $output = []; From 45e890d4ec6980715f94c5775f49b861b80e0efc Mon Sep 17 00:00:00 2001 From: Siarhei Karavai Date: Mon, 31 Oct 2022 17:52:16 +0300 Subject: [PATCH 10/10] Update SuggestEndpoint.php --- src/SearchEndpoint/SuggestEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchEndpoint/SuggestEndpoint.php b/src/SearchEndpoint/SuggestEndpoint.php index 6d292239..733b3efc 100644 --- a/src/SearchEndpoint/SuggestEndpoint.php +++ b/src/SearchEndpoint/SuggestEndpoint.php @@ -27,7 +27,7 @@ class SuggestEndpoint extends AbstractSearchEndpoint /** * {@inheritdoc} */ - public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []) + public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = []): array|string|int|float|bool { $output = []; if (count($this->getAll()) > 0) {