Problem/Motivation

Method "Symfony\Component\Validator\Mapping\MetadataInterface::findConstraints()" will return "array" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\TypedDataMetadata" will be required when upgrading.

Method "Symfony\Component\Validator\Mapping\MetadataInterface::getConstraints()" will return "array" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\TypedDataMetadata" will be required when upgrading.

Method "Symfony\Component\Validator\Mapping\MetadataInterface::getTraversalStrategy()" will return "int" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\TypedDataMetadata" will be required when upgrading.

Method "Symfony\Component\Validator\Mapping\MetadataInterface::getCascadingStrategy()" will return "int" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\TypedDataMetadata" will be required when upgrading.

Steps to reproduce

Proposed resolution

Add the type hints.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daffie created an issue. See original summary.

daffie’s picture

Status: Active » Needs review
FileSize
1.14 KB

The fix.

daffie’s picture

Priority: Normal » Critical
Issue tags: +Drupal 10

I could not find any instances were contrib is extending the class Drupal\Core\TypedData\Validation\TypedDataMetadata. The adding of the return type hints does not change anything as the methods already only returning what the added type hints are demanding. See: http://grep.xnddx.ru/search?text=TypedDataMetadata&filename=.

Part of the Symfony 6 in D10 initiative.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

The patch adds the typehints as per the deprecation.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed e14f655 and pushed to 9.3.x. Thanks!

  • larowlan committed e14f655 on 9.3.x
    Issue #3231690 by daffie: [Symfony 6] Add type hints to Drupal\Core\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.