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.
Tags
None
Referenced Files
F3730707: D25711.1745733909.diff
Sat, Apr 26, 06:05
F3712448: D25711.1745682010.diff
Fri, Apr 25, 15:40
F3711980: D25711.1745666575.diff
Fri, Apr 25, 11:22
F3681809: D25711.1745561231.diff
Thu, Apr 24, 06:07
F3620231: D25711.1745310074.diff
Mon, Apr 21, 08:21
F3576296: D25711.1745039258.diff
Fri, Apr 18, 05:07
F3501961: D25711.1744795811.diff
Tue, Apr 15, 09:30
F3424680: D25711.1744646155.diff
Sun, Apr 13, 15:55

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