From 95c9835dc215f7139a0868ed5a3c4df4c779ae50 Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Sat, 18 Sep 2021 11:02:45 +1000
Subject: [PATCH] Issue #3233481 by daffie: [Symfony 6] Add type hints to the
 methods overriding
 Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface::getMetadataFor()
 and ::hasMetadataFor()

---
 .../Drupal/Core/TypedData/Validation/RecursiveValidator.php  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php b/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php
index 4dded17145f8..e72dea2b7b05 100644
--- a/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php
+++ b/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php
@@ -7,6 +7,7 @@
 use Symfony\Component\Validator\ConstraintValidatorFactoryInterface;
 use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface;
 use Symfony\Component\Validator\Context\ExecutionContextInterface;
+use Symfony\Component\Validator\Mapping\MetadataInterface;
 use Symfony\Component\Validator\Validator\ContextualValidatorInterface;
 use Symfony\Component\Validator\Validator\ValidatorInterface;
 
@@ -69,7 +70,7 @@ public function inContext(ExecutionContextInterface $context): ContextualValidat
    * @param \Drupal\Core\TypedData\TypedDataInterface $typed_data
    *   A typed data object containing the value to validate.
    */
-  public function getMetadataFor($typed_data) {
+  public function getMetadataFor($typed_data): MetadataInterface {
     if (!$typed_data instanceof TypedDataInterface) {
       throw new \InvalidArgumentException('The passed value must be a typed data object.');
     }
@@ -79,7 +80,7 @@ public function getMetadataFor($typed_data) {
   /**
    * {@inheritdoc}
    */
-  public function hasMetadataFor($value) {
+  public function hasMetadataFor($value): bool {
     return $value instanceof TypedDataInterface;
   }
 
-- 
GitLab