I'm not sure if simultaneous support for running Phan on PHP 7.4 and PHP 8.1 is necessary. If it is, some ugly hacks will be needed since the versions contradict each other.
I have a patch which reduces the number of failures from 27 to 6.
I'm not sure if simultaneous support for running Phan on PHP 7.4 and PHP 8.1 is necessary. If it is, some ugly hacks will be needed since the versions contradict each other.
I have a patch which reduces the number of failures from 27 to 6.
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Stalled | None | T255792 Quibble runs core:unit tests twice! | |||
Open | None | T328919 Upgrade to PHPUnit 10 | |||
Open | None | T338103 Micro-optimize ApiResult::isMetadataKey with str_starts_with once we support PHP8+ | |||
Open | None | T328921 Drop PHP 7.4 support from MediaWiki | |||
Stalled | None | T334726 Use return type `never` in Wikibase | |||
Open | None | T328922 Drop PHP 8.0 support from MediaWiki | |||
Stalled | Krinkle | T319432 Migrate WMF production from PHP 7.4 to PHP 8.1 | |||
Resolved | Jdforrester-WMF | T316078 Make PHP 8.1 voting on development (master) branch of MW ecosystem (core, extensions, skins, libraries) | |||
Resolved | tstarling | T322278 MediaWiki core should pass Phan on PHP 8.1 |
Change 852326 had a related patch set uploaded (by Tim Starling; author: Tim Starling):
[mediawiki/core@master] Respond to some messages from Phan on PHP 8.1
+ @Daimona our Phan expert.
I have triggers Phan under PHP 8.1 by commenting check experimental on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/852326/3 which yields:
includes/htmlform/fields/HTMLTimezoneField.php:88 PhanImpossibleTypeComparison Impossible attempt to check if $identifiers of type array is identical to false of type false includes/language/LocalisationCache.php:1029 UnusedPluginSuppression Plugin BuiltinSuppressionPlugin suppresses issue PhanTypePossiblyInvalidDimOffset on this line but this suppression is unused or suppressed elsewhere includes/libs/MappedIterator.php:79 PhanUndeclaredMethod Call to undeclared method \Traversable::current includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php:68 PhanUndeclaredMethod Call to undeclared method \Traversable::current includes/parser/Parser.php:3538 PhanPluginRedundantAssignment Assigning null to variable $revisionRecord which already has that value includes/password/Pbkdf2PasswordUsingHashExtension.php:49 PhanRedundantCondition Redundant attempt to cast $hash of type string to string
Some have @phan-suppress-next-line indentation albeit with a different error name. Maybe the names are slightly different when run under php 8+ or they hit some differences. The last one explicitly states the cast is no more necessary on PHP 8.0+.
Under PHP 8.0 there are a lot of PhanUndeclaredClassAttribute Reference to undeclared class \ReturnTypeWillChange in an attribute (annotations added via T289879). Maybe we need a stub for this class when running under PHP 8.0?
Yes, those are the 6 errors I mentioned. My analysis:
Change 852326 merged by jenkins-bot:
[mediawiki/core@master] Respond to some messages from Phan on PHP 8.1
Change 854649 had a related patch set uploaded (by Tim Starling; author: Tim Starling):
[mediawiki/core@master] Improve LocalisationCache post-merge validation check
Change 854653 had a related patch set uploaded (by Tim Starling; author: Tim Starling):
[mediawiki/core@master] Fix the remaining Phan failures on PHP 8.1
Change 854649 merged by jenkins-bot:
[mediawiki/core@master] Improve LocalisationCache post-merge validation check
Change 854653 merged by jenkins-bot:
[mediawiki/core@master] Fix the remaining Phan failures on PHP 8.1
Change 855046 had a related patch set uploaded (by Jforrester; author: Jforrester):
[integration/config@master] Zuul: [mediawiki/core] Add PHP 8.1 phan job
I talked with @Krinkle about this yesterday. He suggested not running Phan on PHP 8.0. Just run PHPUnit only.
Change 855046 merged by jenkins-bot:
[integration/config@master] Zuul: [mediawiki/core] Add PHP 8.1 phan job
Mentioned in SAL (#wikimedia-releng) [2022-11-09T23:02:25Z] <James_F> Zuul: [mediawiki/core] Add PHP 8.1 phan job for T322278
Change 875924 had a related patch set uploaded (by Reedy; author: Tim Starling):
[mediawiki/core@REL1_39] Improve LocalisationCache post-merge validation check
Change 875925 had a related patch set uploaded (by Umherirrender; author: Tim Starling):
[mediawiki/core@REL1_39] Respond to some messages from Phan on PHP 8.1
Change 875924 merged by jenkins-bot:
[mediawiki/core@REL1_39] Improve LocalisationCache post-merge validation check
Change 876047 had a related patch set uploaded (by Reedy; author: Tim Starling):
[mediawiki/core@REL1_39] Fix the remaining Phan failures on PHP 8.1
Change 876047 merged by jenkins-bot:
[mediawiki/core@REL1_39] Fix the remaining Phan failures on PHP 8.1
Change 875925 merged by jenkins-bot:
[mediawiki/core@REL1_39] Respond to some messages from Phan on PHP 8.1