Page MenuHomePhabricator

Numerous unused consts in Wikibase
Closed, ResolvedPublic

Description

Noticed while doing T253169: Clean up PSR12.Properties.ConstantVisibility.NotFound phpcs exclusion in WMF Prod, there are numerous unused (and now private) consts around the Wikibase code base..

Event Timeline

Is there a good way to find them, other than searching for all private consts and checking (e.g. in one’s IDE) if they’re used?

A decent IDE should have a check for unused variables (or similar) that will be able to work it out. PhpStorm definitely has one that shows it, as it was showing some of the const names in light grey (meaning they're unused).

So should just be a case of finding one "manually" in the repo, and then look which inspection is firing. I can have another look when the stack of patches are merged :)

I note I do have https://plugins.jetbrains.com/plugin/7622-php-inspections-ea-extended- also installed, but I don't think the inspection is necessarily (ie it's a core one)

Change 650517 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Fix unused private members

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

Change 650517 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Fix unused private members

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

Yeah, I think this is done. If anyone else finds unused consts, they’re free to remove them, but I don’t think it makes sense to go hunting for them now or otherwise verify this task.