In mediawiki's phan config, there is the following
// This helps a lot in discovering bad code, but unfortunately it will always fail for // hooks + pass by reference, see phan issue #2943. // @todo Enable when the issue above is resolved and we update our config! $cfg['redundant_condition_detection'] = false;
https://github.com/phan/phan/issues/2943 appears to have been resolved with https://github.com/phan/phan/pull/3176 in September 2019; has the config been updated to allow enabling this?
Regardless, removing the disabling just to see the result shows that there are some issues that would have been caught that are not related to hooks and should be fixed