diff options
author | C. Scott Ananian <cscott@cscott.net> | 2020-03-31 11:44:04 -0400 |
---|---|---|
committer | C. Scott Ananian <cscott@cscott.net> | 2020-03-31 11:47:34 -0400 |
commit | a5afda55bfbdf7b18b21ad3b41ec281bf8f5130c (patch) | |
tree | cf1674f33c7b00537a3cbf610c78ad60c37abd41 /includes/parser | |
parent | 3a7ecc11b4dfb54b07eea002d8391c1b9dcc3388 (diff) | |
download | mediawikicore-a5afda55bfbdf7b18b21ad3b41ec281bf8f5130c.tar.gz mediawikicore-a5afda55bfbdf7b18b21ad3b41ec281bf8f5130c.zip |
Deprecate most public fields of Parser; make private those unused outside core
Fields which have at least one user outside of mediawiki-core (as reported
by the 'everything' search in codesearch.wmflabs.org) have been deprecated;
those which have no users have been immediately made private.
Code search url for the fields made private:
https://codesearch.wmflabs.org/search/?q=-%3E%28mFunctionSynonyms%7CmFunctionTagHooks%7CmStripList%7CmVarCache%7CmImageParams%7CmImageParamsMagicArray%7CmSubstWords%7CmConf%7CmExtLinkBracketedRegex%7CmUrlProtocols%7CmAutonumber%7CmLinkHolders%7CmDefaultSort%7CmTplRedirCache%7CmForceTocPosition%7CmTplDomCache%7CmOutputType%7CmLangLinkLanguages%7CcurrentRevisionCache%7CmProfiler%7CmLinkRenderer%29&i=nope&files=&repos=
Bug: T248889
Change-Id: I28e88e574ec9f99231bd590e9a87fbc1c4349fa1
Diffstat (limited to 'includes/parser')
-rw-r--r-- | includes/parser/Parser.php | 68 |
1 files changed, 45 insertions, 23 deletions
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index eb5be140a018..65254c5ac773 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -144,19 +144,21 @@ class Parser { const MAX_TTS = 900; # Persistent: + /** @deprecated since 1.35; use Parser::getTags() */ public $mTagHooks = []; + /** @deprecated since 1.35; use Parser::getFunctionHooks() */ public $mFunctionHooks = []; - public $mFunctionSynonyms = [ 0 => [], 1 => [] ]; + private $mFunctionSynonyms = [ 0 => [], 1 => [] ]; + private $mFunctionTagHooks = []; + private $mStripList = []; + private $mVarCache = []; + private $mImageParams = []; + private $mImageParamsMagicArray = []; /** @deprecated since 1.35 */ - public $mFunctionTagHooks = []; - public $mStripList = []; - /** @deprecated since 1.35 */ - public $mVarCache = []; - public $mImageParams = []; - public $mImageParamsMagicArray = []; public $mMarkerIndex = 0; /** * @var bool Whether firstCallInit still needs to be called + * @deprecated since 1.35 */ public $mFirstCall = true; @@ -170,65 +172,76 @@ class Parser { /** * @var MagicWordArray */ - public $mSubstWords; + private $mSubstWords; /** * @deprecated since 1.34, there should be no need to use this * @var array */ - public $mConf; + private $mConf; # Initialised in constructor - public $mExtLinkBracketedRegex, $mUrlProtocols; + private $mExtLinkBracketedRegex, $mUrlProtocols; # Initialized in getPreprocessor() /** * @var Preprocessor + * @deprecated since 1.35 */ public $mPreprocessor; # Cleared with clearState(): /** * @var ParserOutput + * @deprecated since 1.35; use Parser::getOutput() */ public $mOutput; - public $mAutonumber; + private $mAutonumber; /** * @var StripState + * @deprecated since 1.35, use Parser::getStripState() */ public $mStripState; /** * @var LinkHolderArray */ - public $mLinkHolders; + private $mLinkHolders; /** * @var int + * @deprecated since 1.35; use Parser::nextLinkID() / ::setLinkID() */ public $mLinkID; + /** @deprecated since 1.35 */ public $mIncludeSizes; + /** @deprecated since 1.35 */ public $mPPNodeCount; /** * @deprecated since 1.35, Preprocessor_DOM was removed and this counter * is no longer incremented by anything. */ public $mGeneratedPPNodeCount; + /** @deprecated since 1.35 */ public $mHighestExpansionDepth; - public $mDefaultSort; - public $mTplRedirCache; + private $mDefaultSort; + private $mTplRedirCache; /** @internal */ public $mHeadings; + /** @deprecated since 1.35 */ public $mDoubleUnderscores; + /** @deprecated since 1.35 */ public $mExpensiveFunctionCount; # number of expensive parser function calls + /** @deprecated since 1.35 */ public $mShowToc; - public $mForceTocPosition; + private $mForceTocPosition; /** @var array */ - public $mTplDomCache; + private $mTplDomCache; /** * @var User + * @deprecated since 1.35, use Parser::getUser() */ public $mUser; # User object; only used when doing pre-save transform @@ -237,6 +250,7 @@ class Parser { /** * @var ParserOptions|null + * @deprecated since 1.35, use Parser::getOptions() */ public $mOptions; @@ -244,17 +258,24 @@ class Parser { * Since 1.34, leaving `mTitle` uninitialized or setting `mTitle` to * `null` is deprecated. * - * @internal * @var Title|null + * @deprecated since 1.35, use Parser::getTitle() */ public $mTitle; # Title context, used for self-link rendering and similar things - public $mOutputType; # Output type, one of the OT_xxx constants + private $mOutputType; # Output type, one of the OT_xxx constants + /** @deprecated since 1.35 */ public $ot; # Shortcut alias, see setOutputType() + /** @deprecated since 1.35, use Parser::getRevisionObject() */ public $mRevisionObject; # The revision object of the specified revision ID + /** @deprecated since 1.35, use Parser::getRevisionId() */ public $mRevisionId; # ID to display in {{REVISIONID}} tags + /** @deprecated since 1.35, use Parser::getRevisionTimestamp() */ public $mRevisionTimestamp; # The timestamp of the specified revision ID + /** @deprecated since 1.35, use Parser::getRevisionUser() */ public $mRevisionUser; # User to display in {{REVISIONUSER}} tag + /** @deprecated since 1.35, use Parser::getRevisionSize() */ public $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable + /** @deprecated since 1.35 */ public $mInputSize = false; # For {{PAGESIZE}} on current page. /** @@ -262,7 +283,7 @@ class Parser { * interwiki prefix) in the key, value arbitrary. Used to avoid sending * duplicate language links to the ParserOutput. */ - public $mLangLinkLanguages; + private $mLangLinkLanguages; /** * @var MapCacheLRU|null @@ -270,22 +291,23 @@ class Parser { * * A cache of the current revisions of titles. Keys are $title->getPrefixedDbKey() */ - public $currentRevisionCache; + private $currentRevisionCache; /** * @var bool|string Recursive call protection. * @internal - * This variable should be treated as if it were private. + * @deprecated since 1.35; this variable should be treated as if it + * were private. */ public $mInParse = false; /** @var SectionProfiler */ - protected $mProfiler; + private $mProfiler; /** * @var LinkRenderer */ - protected $mLinkRenderer; + private $mLinkRenderer; /** @var MagicWordFactory */ private $magicWordFactory; |