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\Context\ExecutionContextInterface::getObject()" will return "?object" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" will be required when upgrading.
Method "Symfony\Component\Validator\Context\ExecutionContextInterface::getMetadata()" will return "?MetadataInterface" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" will be required when upgrading.
Method "Symfony\Component\Validator\Context\ExecutionContextInterface::getGroup()" will return "?string" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" will be required when upgrading.
Method "Symfony\Component\Validator\Context\ExecutionContextInterface::getClassName()" will return "?string" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" will be required when upgrading.
Method "Symfony\Component\Validator\Context\ExecutionContextInterface::getPropertyName()" will return "?string" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" will be required when upgrading.
Method "Symfony\Component\Validator\Context\ExecutionContextInterface::getPropertyPath()" will return "string" as of its next major version. Doing the same in implementation "Drupal\Core\TypedData\Validation\ExecutionContext" 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 | 3231689-2.patch | 1.33 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\ExecutionContext. 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=ExecutionContext&filename=.
Part of the Symfony 6 in D10 initiative.
Comment #4
longwaveThe patch adds the typehints as per the deprecation.
Comment #6
larowlanCommitted 2eb9e5f and pushed to 9.3.x. Thanks!