Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | 3231690-2.patch | 1.14 KB | daffie |
Comments
Comment #2
daffie CreditAttribution: daffie commentedThe fix.
Comment #3
daffie CreditAttribution: daffie commentedI 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.
Comment #4
longwaveThe patch adds the typehints as per the deprecation.
Comment #5
larowlanCommitted e14f655 and pushed to 9.3.x. Thanks!