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
F2991900: D25711.1740198715.diff
Fri, Feb 21, 04:31
F2991899: D25711.1740198714.diff
Fri, Feb 21, 04:31
F2990360: D25711.1740177340.diff
Thu, Feb 20, 22:35
F2981963: D25711.1739943124.diff
Tue, Feb 18, 05:32
F2950804: D25711.1738838149.diff
Wed, Feb 5, 10:35
F2913273: D25711.1737424805.diff
Jan 20 2025, 02:00
F2913272: D25711.1737424803.diff
Jan 20 2025, 02:00
F2908556: D25711.1737379282.diff
Jan 19 2025, 13:21

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
Branch
T15835IteratorAnnotate
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1411
Build 1411: arc lint + arc unit