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
F3340610: D25711.1743639434.diff
Wed, Apr 2, 00:17
F3337729: D25711.1743591717.diff
Tue, Apr 1, 11:01
F3331238: D25711.1743503954.diff
Mon, Mar 31, 10:39
F3327723: D25711.1743444684.diff
Sun, Mar 30, 18:11
F3324283: D25711.1743398632.diff
Sun, Mar 30, 05:23
F3318952: D25711.1743293948.diff
Sat, Mar 29, 00:19
F3301778: D25711.1743057843.diff
Wed, Mar 26, 06:44
F3298924: D25711.1743012084.diff
Tue, Mar 25, 18:01

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