tstarling added a comment.
When phan is checking for a signature match, it first checks whether the
names match:
if (!$overridden_parameter_union_type->isEqualTo($parameter_union_type) &&
That always fails in the case of an alias. Then if the target PHP version is
7.4+, it checks for what the PHP manual calls contravariance
<https://www.php.net/manual/en/language.oop5.variance.php>:
$is_exception_to_rule =
(Config::get_closest_minimum_target_php_version_id() >= 70400 &&
$overridden_parameter_union_type->isStrictSubtypeOf($code_base,
$parameter_union_type)) ||
That check passes for an alias. So Phan does not properly implement alias
checks for class overrides, but it accidentally works for
--target-php-version=7.4 due to the contravariance feature.
TASK DETAIL
https://phabricator.wikimedia.org/T308443
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: tstarling
Cc: Reedy, ItamarWMDE, Michael, RhinosF1, Krinkle, tstarling, kostajh,
Aklapper, Lucas_Werkmeister_WMDE, Astuthiodit_1, Sgs, karapayneWMDE, Invadibot,
caldera, maantietaja, NavinRizwi, Akuckartz, DannyS712, Nandana, Lahi, Gq86,
Daimona, GoranSMilovanovic, Nattes, QZanden, LawExplorer, Iniquity, _jensen,
rosalieper, Taiwania_Justo, Scott_WUaS, Wikidata-bugs, aude, geraki,
Jdforrester-WMF, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]