Page MenuHomePhabricator

Decrease public variables in Language class
Closed, ResolvedPublic

Description

Motivation:

class Language contains a lot of public and unused members. A few of them:

  • public $mVariants - isn't even assigned
  • public $mLoaded - isn't even assigned
  • public $mMagicExtensions = []; - assigned and even has redundant logic:

https://codesearch.wmflabs.org/search/?q=mMagicExtensions&i=nope&files=&repos=

  • private $mParentLanguage = false; - isn't used
  • public $transformData = [];

...
etc.

This introduces difficulties in supporting further versions.

Expected result:

  • Unused variables should be removed.
  • Variables that isn't used from outside should be protected/private
  • changed variables should be deprecated.

Details

Related Gerrit Patches:
mediawiki/core : masterReduce usage of the Language class

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 29 2020, 3:51 PM

Looks good to me. Maybe @Nikerabbit wants to have a look.

Change 570606 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] component: Strip \Language

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

Change 570606 merged by jenkins-bot:
[mediawiki/core@master] Reduce usage of the Language class

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

daniel closed this task as Resolved.Fri, Mar 27, 10:42 AM