Testing D7 Entity API with PHP 8.1 shows some new errors due to deprecated methods in PHP. See https://www.drupal.org/pift-ci-job/2237654
These are all similar to:
Return type of EntityStructureWrapper::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Because we can't use return type hinting in Drupal 7, we will need to add the #[\ReturnTypeWillChange] attribute to tell PHP 8.1 to ignore these deprecation notices. The attribute is seen as a code comment so this won't break any code running on lower PHP versions.
This issue is a blocker for a new D7 release of Entity API.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3249556-2-return-type-will-change.patch | 3.59 KB | tr |
Comments
Comment #2
tr commentedComment #3
tr commentedThose failures are with the Rules integration test, and those failures will go away when there is a new Rules D7 release that supports PHP 8.1.
The patch did eliminate the PHP 8.1 failures shown in https://www.drupal.org/pift-ci-job/2237654
Comment #5
tr commentedCommitted.