Problem/Motivation

Use phpstan tool was found deprecated function notice occurs in PHP 8.1
------ ----------------------------------------------------------------------------------------------------------------------------------------------
Line /tmgmt/translators/file/tmgmt_file.recursive_iterator.inc
------ ----------------------------------------------------------------------------------------------------------------------------------------------
42 Return type mixed of method RecursiveDOMIterator::current() is not covariant with tentative return type mixed of method Iterator::current().
52 Return type mixed of method RecursiveDOMIterator::getChildren() is not covariant with tentative return type RecursiveIterator|null of method RecursiveIterator::getChildren().
62 Return type mixed of method RecursiveDOMIterator::hasChildren() is not covariant with tentative return type bool of method
RecursiveIterator::hasChildren().
72 Return type mixed of method RecursiveDOMIterator::key() is not covariant with tentative return type mixed of method Iterator::key().
79 Return type mixed of method RecursiveDOMIterator::next() is not covariant with tentative return type void of method Iterator::next().
86 Return type mixed of method RecursiveDOMIterator::rewind() is not covariant with tentative return type void of method Iterator::rewind().
96 Return type mixed of method RecursiveDOMIterator::valid() is not covariant with tentative return type bool of method Iterator::valid().
------ ----------------------------------------------------------------------------------------------------------------------------------------------

Proposed resolution

Update the function type of return value.

Comments

Igumnov_aleksey created an issue. See original summary.

Igumnov_aleksey’s picture

Igumnov_aleksey’s picture

Status: Fixed » Needs review
berdir’s picture

Status: Needs review » Needs work

While the configured php version is very old, this will break compatibility with older php versions. We should add the annotation like I did in #3352099: Fix D10.1 test fails for 8.x-1.x instaed.

Igumnov_aleksey’s picture

StatusFileSize
new1.9 KB

This decision is made from the fact that if Drupal 7 will work on php8.1