Page MenuHomePhorge

Suppress PHP 8.1 warnings "Return type mixed is not covariant with tentative return type mixed of method Iterator::key()"
ClosedPublic

Authored by aklapper on Jul 2 2024, 13:04.

Details

Summary

PHP 8.1 requires classes which implement Iterator to have all Iterator methods declared with appropriate return types or annotated with #[\ReturnTypeWillChange]. In my (limited) understanding we cannot declare return types while remaining backward-compatible, thus annotate.

Closes T15835

Test Plan

Run PHPStan static code analyzer, see no warnings anymore.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable