From 203654b2345d5a378dc663145924b6acf8bf49c7 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 13 Dec 2021 12:07:37 +0000
Subject: [PATCH] Issue #3232063 by paulocs, daffie, longwave: [Symfony 6] Add
 "bool" type hint to
 Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization() and
 subclasses

---
 core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php  | 2 +-
 core/modules/jsonapi/src/Serializer/Serializer.php              | 2 +-
 core/modules/serialization/src/Normalizer/NormalizerBase.php    | 2 +-
 .../serialization_test/src/SerializationTestNormalizer.php      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php b/core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php
index a905c609a92c..efdae5241dc2 100644
--- a/core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php
+++ b/core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php
@@ -67,7 +67,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ent
   /**
    * {@inheritdoc}
    */
-  public function supportsNormalization($data, $format = NULL) {
+  public function supportsNormalization($data, $format = NULL): bool {
     return FALSE;
   }
 
diff --git a/core/modules/jsonapi/src/Serializer/Serializer.php b/core/modules/jsonapi/src/Serializer/Serializer.php
index 709cf770949c..cb45e8984cc3 100644
--- a/core/modules/jsonapi/src/Serializer/Serializer.php
+++ b/core/modules/jsonapi/src/Serializer/Serializer.php
@@ -80,7 +80,7 @@ public function denormalize($data, $type, $format = NULL, array $context = []) {
   /**
    * {@inheritdoc}
    */
-  public function supportsNormalization($data, $format = NULL, array $context = []) {
+  public function supportsNormalization($data, $format = NULL, array $context = []): bool {
     return $this->selfSupportsNormalization($data, $format, $context) || $this->fallbackNormalizer->supportsNormalization($data, $format, $context);
   }
 
diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php
index f1539b62a631..f98e94e26bfa 100644
--- a/core/modules/serialization/src/Normalizer/NormalizerBase.php
+++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php
@@ -30,7 +30,7 @@ abstract class NormalizerBase implements SerializerAwareInterface, CacheableNorm
   /**
    * {@inheritdoc}
    */
-  public function supportsNormalization($data, $format = NULL) {
+  public function supportsNormalization($data, $format = NULL): bool {
     // If we aren't dealing with an object or the format is not supported return
     // now.
     if (!is_object($data) || !$this->checkFormat($format)) {
diff --git a/core/modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php b/core/modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php
index 35300d8a8cdc..cc205e8cd7a9 100644
--- a/core/modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php
+++ b/core/modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php
@@ -47,7 +47,7 @@ public function normalize($object, $format = NULL, array $context = []) {
    * @return bool
    *   Returns TRUE if the normalizer can handle the request.
    */
-  public function supportsNormalization($data, $format = NULL) {
+  public function supportsNormalization($data, $format = NULL): bool {
     return static::$format === $format;
   }
 
-- 
GitLab