Steps to replicate the issue (include links if applicable):
- When using mediawiki/mediawiki-phan-config with version 0.13.0 on the Vector skin I would expect the following code to emit a issue about the use of empty()
private function canHaveLanguages(): bool { $action = $this->getContext()->getActionName(); // FIXME: This logic should be moved into the ULS extension or core given the button is hidden, // it should not be rendered, short term fix for T328996. if ( $action === 'history' ) { return false; } $title = $this->getTitle(); // Defensive programming - if a special page has added languages explicitly, best to show it. if ( $title && $title->isSpecialPage() && empty( $this->getLanguagesCached() ) ) { # <!--- not reported return false; } return true; }
What happens?:
No warning, it seems the new plugin (from T234237) has a focus on variables/class properties.
What should have happened instead?:
Expected message:
Found usage of empty() on expression $this->getLanguagesCached() that is always set. empty() should only be used to suppress errors. See https://w.wiki/6paE