Unverified Commit 95c9835d authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3233481 by daffie: [Symfony 6] Add type hints to the methods overriding...

Issue #3233481 by daffie: [Symfony 6] Add type hints to the methods overriding Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface::getMetadataFor() and ::hasMetadataFor()
parent c1831be5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
  }