Page MenuHomePhabricator

Deprecate methods of WikiPage and Article (with sub-classes) to use private/protected methods instead of public in 1.36 version
Open, Needs TriagePublic

Description

Context:

I found many public methods of WikiPage and Article that not unused outside of class, while I was working with https://phabricator.wikimedia.org/T239975

I recommend:

  • to research the usage of these methods and properties
  • to deprecate these methods and properties
  • to make private/protected in 1.36

Goal:

  • to improve WikiPage/Article
  • to minimize the visibility of methods (make public is allowed when is really needed)

Methods for minimizing of visibility:

  • \ImagePage::getFile
  • \WikiPage::loadFromRow (external load data not exist)

and add public \WikiPage::loadEmptyData (separate logic for load data and clear)
https://codesearch.wmflabs.org/deployed/?q=loadFromRow&i=nope&files=%5C.php%24&repos=

  • \WikiPage::protectDescription

https://codesearch.wmflabs.org/deployed/?q=protectDescription%5C(&i=nope&files=%5C.php%24&repos=

  • \WikiPage::protectDescriptionLog

https://codesearch.wmflabs.org/deployed/?q=protectDescriptionLog%5C(&i=nope&files=%5C.php%24&repos=

  • \WikiPage::doDeleteUpdates

https://codesearch.wmflabs.org/deployed/?q=doDeleteUpdates%5C(&i=nope&files=%5C.php%24&repos=

  • \WikiPage::getDeletionUpdates

https://codesearch.wmflabs.org/deployed/?q=getDeletionUpdates%5C(&i=nope&files=%5C.php%24&repos=