Page MenuHomePhabricator

phan PHP 8.1 failures on MW 1.39
Closed, ResolvedPublic

Description

22:53:25 includes/ForkController.php:187 PhanImpossibleTypeComparisonInLoop Impossible attempt to check if $pid of type int is identical to false of type false in a loop body (likely a false positive)
22:53:25 includes/Message/UserGroupMembershipParam.php:29 PhanRedefinedInheritedInterface \MediaWiki\Message\UserGroupMembershipParam inherits abstract Interface \Stringable declared at internal:0 which is also declared at vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php:4. This may lead to confusing errors.
22:53:25 includes/OrderedStreamingForkController.php:87 PhanImpossibleTypeComparisonInLoop Impossible attempt to check if $pid of type int is identical to false of type false in a loop body (likely a false positive)
22:53:25 includes/ResourceLoader/Image.php:365 PhanTypeMismatchArgumentNullableInternal Argument 1 ($node) is $node of type ?\DOMNode but \DOMElement::appendChild() takes \DOMNode (expected type to be non-nullable)
22:53:25 includes/ResourceLoader/VueComponentParser.php:93 PhanTypeMismatchArgumentNullableInternal Argument 1 ($string) is $nodes['script']->nodeValue of type ?string but \trim() takes string (expected type to be non-nullable)
22:53:25 includes/ResourceLoader/VueComponentParser.php:162 PhanTypeMismatchArgumentNullableInternal Argument 1 ($string) is $styleNode->nodeValue of type ?string but \trim() takes string (expected type to be non-nullable)
22:53:25 includes/Settings/Source/Format/SettingsFormat.php:15 PhanRedefinedInheritedInterface \MediaWiki\Settings\Source\Format\SettingsFormat inherits abstract Interface \Stringable declared at internal:0 which is also declared at vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php:4. This may lead to confusing errors.
22:53:25 includes/Settings/Source/SettingsSource.php:16 PhanRedefinedInheritedInterface \MediaWiki\Settings\Source\SettingsSource inherits abstract Interface \Stringable declared at internal:0 which is also declared at vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php:4. This may lead to confusing errors.
22:53:25 includes/debug/logger/monolog/LegacyHandler.php:145 UnusedPluginSuppression Plugin BuiltinSuppressionPlugin suppresses issue PhanTypeMismatchProperty on this line but this suppression is unused or suppressed elsewhere
22:53:25 includes/debug/logger/monolog/LegacyHandler.php:146 PhanTypeMismatchPropertyProbablyReal Assigning socket_create($domain, SOCK_DGRAM, SOL_UDP) of type \Socket|false to property but \MediaWiki\Logger\Monolog\LegacyHandler->sink is null|resource (no real type) (the inferred real assigned type has nothing in common with the declared phpdoc property type)
22:53:25 includes/language/LocalisationCache.php:1032 UnusedPluginSuppression Plugin BuiltinSuppressionPlugin suppresses issue PhanTypePossiblyInvalidDimOffset on this line but this suppression is unused or suppressed elsewhere
22:53:25 includes/libs/MappedIterator.php:79 PhanUndeclaredMethod Call to undeclared method \Traversable::current
22:53:25 includes/libs/filebackend/fileiteration/FileBackendStoreShardListIterator.php:68 PhanUndeclaredMethod Call to undeclared method \Traversable::current
22:53:25 includes/libs/rdbms/database/DatabaseMysqli.php:199 PhanRedundantCondition Redundant attempt to cast $this->conn->errno of type int to int
22:53:25 includes/parser/Parser.php:95 PhanUndeclaredClassAttribute Reference to undeclared class \AllowDynamicProperties in an attribute
22:53:25 includes/parser/Parser.php:3551 PhanPluginRedundantAssignment Assigning null to variable $revisionRecord which already has that value
22:53:25 includes/password/BcryptPassword.php:80 PhanRedundantCondition Redundant attempt to cast $hash of type string to string
22:53:25 includes/password/MWOldPassword.php:52 PhanRedundantCondition Redundant attempt to cast $this->hash of type string to string
22:53:25 includes/password/MWSaltedPassword.php:48 PhanRedundantCondition Redundant attempt to cast $this->hash of type string to string
22:53:25 includes/password/Pbkdf2Password.php:62 PhanRedundantCondition Redundant attempt to cast $hash of type string to string
22:53:25 includes/preferences/DefaultPreferencesFactory.php:2032 PhanImpossibleTypeComparison Impossible attempt to check if $identifiers of type array is identical to false of type false
22:53:25 includes/specials/SpecialWatchlist.php:826 PhanRedundantCondition Redundant attempt to cast ($selectedHours / 24) of type float to float
22:53:25 includes/user/User.php:69 PhanUndeclaredClassAttribute Reference to undeclared class \AllowDynamicProperties in an attribute
22:53:25 includes/xml/Xml.php:186 PhanRedundantCondition Redundant attempt to cast $encMonth of type non-zero-int to int

Maybe some backports from master needed...

Event Timeline

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

https://gerrit.wikimedia.org/r/875925

Job mediawiki-core-php81-phan-docker is not running under experimental in REL1_39, because it is voting on master. It is possible to have experimental on release base to have that job as additional run?

Job mediawiki-core-php81-phan-docker is not running under experimental in REL1_39, because it is voting on master. It is possible to have experimental on release base to have that job as additional run?

It does run under check php... Is that enough? Do we need it experimental too?

Job mediawiki-core-php81-phan-docker is not running under experimental in REL1_39, because it is voting on master. It is possible to have experimental on release base to have that job as additional run?

It does run under check php... Is that enough? Do we need it experimental too?

That is enough. Having release queues for the other checks is overkill. The "run as part of gate-and-submit" is not exact for the releases, but okay to live with.

It passed now, the challenge here was the moved code and classes between REL1_39 and REL1_40 (current master), all the great work between the release cut and the phan fixes.
With T166010 that makes the next releases not easier to manage, hopefully gerrit can follow many of the moved files in the future.

Change 875925 merged by jenkins-bot:

[mediawiki/core@REL1_39] Respond to some messages from Phan on PHP 8.1

https://gerrit.wikimedia.org/r/875925

It is planned to make the phan-php81-job voting on REL1_39?