Testing D7 Rules with PHP 8.1 shows some new errors due to deprecated methods in PHP. See https://www.drupal.org/pift-ci-job/2243125
These are similar to:
Return type of RulesRecursiveElementIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, 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 Rules.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3250504-2-returntypewillchange.patch | 891 bytes | tr |
Comments
Comment #2
tr commentedComment #4
tr commentedTest results show this patch doesn't affect anything under PHP 5.3, as expected, and eliminates the errors mention in the issue summary under PHP 8.1.
Committed #2.