jenkins-bot has submitted this change and it was merged.

Change subject: Declare visibility on class properties of includes/parser/
......................................................................


Declare visibility on class properties of includes/parser/

Change-Id: If03a9bd5eb83be4d15f54e73f49f42540fb7d5fc
---
M includes/parser/CacheTime.php
M includes/parser/DateFormatter.php
M includes/parser/LinkHolderArray.php
M includes/parser/Parser.php
M includes/parser/ParserOptions.php
M includes/parser/ParserOutput.php
M includes/parser/Parser_DiffTest.php
M includes/parser/Preprocessor_DOM.php
M includes/parser/Preprocessor_Hash.php
9 files changed, 576 insertions(+), 373 deletions(-)

Approvals:
  Parent5446: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php
index 464bacd..b44a20f 100644
--- a/includes/parser/CacheTime.php
+++ b/includes/parser/CacheTime.php
@@ -32,11 +32,23 @@
         */
        public $mUsedOptions;
 
-       var     $mVersion = Parser::VERSION,  # Compatibility check
-               $mCacheTime = '',             # Time when this object was 
generated, or -1 for uncacheable. Used in ParserCache.
-               $mCacheExpiry = null,         # Seconds after which the object 
should expire, use 0 for uncachable. Used in ParserCache.
-               $mContainsOldMagic,           # Boolean variable indicating if 
the input contained variables like {{CURRENTDAY}}
-               $mCacheRevisionId = null;     # Revision ID that was parsed
+       /** @var string Compatibility check */
+       protected $mVersion = Parser::VERSION;
+
+       /** @var string Time when this object was generated, or -1 for 
uncacheable. Used in ParserCache. */
+       protected $mCacheTime = '';
+
+       /**
+        * @var int Seconds after which the object should expire, use 0 for 
uncachable.
+        *   Used in ParserCache.
+        */
+       protected $mCacheExpiry = null;
+
+       /** @var bool Boolean variable indicating if the input contained 
variables like {{CURRENTDAY}} */
+       protected $mContainsOldMagic;
+
+       /** @var int Revision ID that was parsed */
+       protected $mCacheRevisionId = null;
 
        /**
         * @return string TS_MW timestamp
diff --git a/includes/parser/DateFormatter.php 
b/includes/parser/DateFormatter.php
index 3ddc9d4..a6092a3 100644
--- a/includes/parser/DateFormatter.php
+++ b/includes/parser/DateFormatter.php
@@ -27,11 +27,40 @@
  * @ingroup Parser
  */
 class DateFormatter {
-       var $mSource, $mTarget;
-       var $monthNames = '', $rxDM, $rxMD, $rxDMY, $rxYDM, $rxMDY, $rxYMD;
+       protected $mSource;
 
-       var $regexes, $pDays, $pMonths, $pYears;
-       var $rules, $xMonths, $preferences;
+       protected $mTarget;
+
+       /** @var string */
+       protected $monthNames = '';
+
+       /** @todo Are these unused? */
+       private $rxDM;
+       private $rxMD;
+       private $rxDMY;
+       private $rxYDM;
+       private $rxMDY;
+       private $rxYMD;
+
+       /** @var array */
+       protected $regexes;
+
+       /** @todo Are these unused? */
+       private $pDays;
+       private $pMonths;
+       private $pYears;
+
+       /** @var array */
+       protected $rules;
+
+       /** @var array */
+       protected $xMonths;
+
+       /** @var array */
+       protected $preferences;
+
+       /** @var bool */
+       protected $mLinked;
 
        protected $lang;
 
diff --git a/includes/parser/LinkHolderArray.php 
b/includes/parser/LinkHolderArray.php
index 2f95af2..00c5a6c 100644
--- a/includes/parser/LinkHolderArray.php
+++ b/includes/parser/LinkHolderArray.php
@@ -25,9 +25,19 @@
  * @ingroup Parser
  */
 class LinkHolderArray {
-       var $internals = array(), $interwikis = array();
-       var $size = 0;
-       var $parent;
+       /** @var array */
+       public $internals = array();
+
+       /** @var array */
+       public $interwikis = array();
+
+       /** @var int */
+       protected $size = 0;
+
+       /** @var Parser */
+       protected $parent;
+
+       /** @var int */
        protected $tempIdOffset;
 
        function __construct( $parent ) {
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 227937a..9866008 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -119,97 +119,166 @@
        const TOC_START = '<mw:toc>';
        const TOC_END = '</mw:toc>';
 
-       # Persistent:
-       var $mTagHooks = array();
-       var $mTransparentTagHooks = array();
-       var $mFunctionHooks = array();
-       var $mFunctionSynonyms = array( 0 => array(), 1 => array() );
-       var $mFunctionTagHooks = array();
-       var $mStripList = array();
-       var $mDefaultStripList = array();
-       var $mVarCache = array();
-       var $mImageParams = array();
-       var $mImageParamsMagicArray = array();
-       var $mMarkerIndex = 0;
-       var $mFirstCall = true;
+       # Persistent
+
+       /** @var array */
+       public $mTagHooks = array();
+
+       /** @var array */
+       public $mTransparentTagHooks = array();
+
+       /** @var array */
+       public $mFunctionHooks = array();
+
+       /** @var array */
+       protected $mFunctionSynonyms = array( 0 => array(), 1 => array() );
+
+       /** @var array */
+       protected $mFunctionTagHooks = array();
+
+       /** @var array */
+       protected $mStripList = array();
+
+       /**
+        * @var array
+        * @todo Unused?
+        */
+       private $mDefaultStripList = array();
+
+       /** @var array */
+       protected $mVarCache = array();
+
+       /** @var array */
+       protected $mImageParams = array();
+
+       /** @var array */
+       protected $mImageParamsMagicArray = array();
+
+       /** @var int */
+       public $mMarkerIndex = 0;
+
+       /** @var bool */
+       protected $mFirstCall = true;
 
        # Initialised by initialiseVariables()
 
-       /**
-        * @var MagicWordArray
-        */
-       var $mVariables;
+       /** @var MagicWordArray */
+       public $mVariables;
 
-       /**
-        * @var MagicWordArray
-        */
-       var $mSubstWords;
-       var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # 
Initialised in constructor
+       /** @var MagicWordArray */
+       protected $mSubstWords;
+
+       # Initialised in constructor
+
+       /** @var array */
+       protected $mConf;
+
+       /** @var Parser */
+       public $mPreprocessor;
+
+       /** @var string */
+       protected $mExtLinkBracketedRegex;
+
+       /** @var string */
+       protected $mUrlProtocols;
 
        # Cleared with clearState():
-       /**
-        * @var ParserOutput
-        */
-       var $mOutput;
-       var $mAutonumber, $mDTopen;
+
+       /** @var ParserOutput */
+       public $mOutput;
+
+       /** @var int */
+       protected $mAutonumber;
+
+       /** @var bool */
+       protected $mDTopen;
+
+       /** @var StripState */
+       public $mStripState;
 
        /**
-        * @var StripState
+        * @var array
+        * @todo Unused?
         */
-       var $mStripState;
-
-       var $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
-       /**
-        * @var LinkHolderArray
-        */
-       var $mLinkHolders;
-
-       var $mLinkID;
-       var $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, 
$mHighestExpansionDepth;
-       var $mDefaultSort;
-       var $mTplExpandCache; # empty-frame expansion cache
-       var $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
-       var $mExpensiveFunctionCount; # number of expensive parser function 
calls
-       var $mShowToc, $mForceTocPosition;
+       private $mIncludeCount;
 
        /**
-        * @var User
+        * @var bool
+        * @todo Unused?
         */
-       var $mUser; # User object; only used when doing pre-save transform
+       private $mArgStack;
+
+       /** @var string */
+       protected $mLastSection;
+
+       /** @var bool */
+       protected $mInPre;
+
+       /** @var LinkHolderArray */
+       protected $mLinkHolders;
+
+       /** @var int */
+       protected $mLinkID;
+
+       /** @var array */
+       protected $mIncludeSizes;
+
+       /** @var int */
+       public $mPPNodeCount;
+
+       /** @var int */
+       public $mGeneratedPPNodeCount;
+
+       /** @var int */
+       public $mHighestExpansionDepth;
+
+       /** @var bool|string */
+       protected $mDefaultSort;
+
+       /** @var array Empty-frame expansion cache */
+       protected $mTplExpandCache;
+
+       /** @var array */
+       protected $mTplRedirCache;
+
+       /** @var array */
+       protected $mTplDomCache;
+
+       /** @var array */
+       public $mHeadings;
+
+       /** @var array */
+       protected $mDoubleUnderscores;
+
+       /** @var int Number of expensive parser function calls */
+       protected $mExpensiveFunctionCount;
+
+       /** @var bool */
+       protected $mShowToc;
+
+       /** @var bool */
+       protected $mForceTocPosition;
+
+       /** @var User User object; only used when doing pre-save transform */
+       protected $mUser;
 
        # Temporary
        # These are variables reset at least once per parse regardless of 
$clearState
 
-       /**
-        * @var ParserOptions
-        */
-       var $mOptions;
+       /** @var ParserOptions */
+       public $mOptions;
 
-       /**
-        * @var Title
-        */
-       var $mTitle;        # Title context, used for self-link rendering and 
similar things
-       var $mOutputType;   # Output type, one of the OT_xxx constants
-       var $ot;            # Shortcut alias, see setOutputType()
-       var $mRevisionObject; # The revision object of the specified revision ID
-       var $mRevisionId;   # ID to display in {{REVISIONID}} tags
-       var $mRevisionTimestamp; # The timestamp of the specified revision ID
-       var $mRevisionUser; # User to display in {{REVISIONUSER}} tag
-       var $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable
-       var $mRevIdForTs;   # The revision ID which was used to fetch the 
timestamp
-       var $mInputSize = false; # For {{PAGESIZE}} on current page.
+       /** @var Title Title context, used for self-link rendering and similar 
things */
+       public $mTitle;
 
-       /**
-        * @var string
-        */
-       var $mUniqPrefix;
+       /** @var array Shortcut alias, see setOutputType() */
+       public $ot;
 
-       /**
-        * @var array Array with the language name of each language link (i.e. 
the
-        * interwiki prefix) in the key, value arbitrary. Used to avoid sending
-        * duplicate language links to the ParserOutput.
-        */
-       var $mLangLinkLanguages;
+       /** @var string The timestamp of the specified revision ID */
+       public $mRevisionTimestamp;
+
+       /** @var string */
+       public $mUniqPrefix;
 
        /**
         * @var boolean Recursive call protection.
@@ -217,6 +286,37 @@
         */
        public $mInParse = false;
 
+       /** @var int Output type, one of the OT_xxx constants */
+       protected $mOutputType;
+
+       /** @var Revision The revision object of the specified revision ID */
+       protected $mRevisionObject;
+
+       /** @var int ID to display in {{REVISIONID}} tags */
+       protected $mRevisionId;
+
+       /** @var string User to display in {{REVISIONUSER}} tag */
+       protected $mRevisionUser;
+
+       /** @var int Size to display in {{REVISIONSIZE}} variable */
+       protected $mRevisionSize;
+
+       /** @var bool|int For {{PAGESIZE}} on current page. */
+       protected $mInputSize = false;
+
+       /**
+        * @var array Array with the language name of each language link (i.e. 
the
+        * interwiki prefix) in the key, value arbitrary. Used to avoid sending
+        * duplicate language links to the ParserOutput.
+        */
+       protected $mLangLinkLanguages;
+
+       /**
+        * @var int The revision ID which was used to fetch the timestamp
+        * @todo Unused?
+        */
+       private $mRevIdForTs;
+
        /**
         * Constructor
         *
diff --git a/includes/parser/ParserOptions.php 
b/includes/parser/ParserOptions.php
index 7c84b67..ba85a66 100644
--- a/includes/parser/ParserOptions.php
+++ b/includes/parser/ParserOptions.php
@@ -29,187 +29,120 @@
  * @ingroup Parser
  */
 class ParserOptions {
+       /** @var bool Parsing the page for a "preview" operation? */
+       public $mIsPreview = false;
+
+       /** @var bool Interlanguage links are removed and returned in an array 
*/
+       protected $mInterwikiMagic;
+
+       /** @var bool Allow external images inline? */
+       protected $mAllowExternalImages;
+
+       /** @var string|array If not, any exception? */
+       protected $mAllowExternalImagesFrom;
+
+       /** @var bool If not or it doesn't match, should we check an on-wiki 
whitelist? */
+       protected $mEnableImageWhitelist;
+
+       /** @var string Date format index */
+       protected $mDateFormat = null;
+
+       /** @var bool Create "edit section" links? */
+       protected $mEditSection = true;
+
+       /** @var bool Allow inclusion of special pages? */
+       protected $mAllowSpecialInclusion;
+
+       /** @var bool Use tidy to cleanup output HTML? */
+       protected $mTidy = false;
 
        /**
-        * Interlanguage links are removed and returned in an array
+        * @var bool Which lang to call for PLURAL and GRAMMAR
+        * @todo FIXME: This comment doesn't appear to be correct.
+        *   Should be this? Whether this is an interface message.
         */
-       var $mInterwikiMagic;
+       protected $mInterfaceMessage = false;
+
+       /** @var string|Language Overrides $mInterfaceMessage with arbitrary 
language */
+       protected $mTargetLanguage = null;
+
+       /** @var int Maximum size of template expansions, in bytes */
+       protected $mMaxIncludeSize;
+
+       /** @var int Maximum number of nodes touched by PPFrame::expand() */
+       protected $mMaxPPNodeCount;
+
+       /** @var int Maximum number of nodes generated by 
Preprocessor::preprocessToObj() */
+       protected $mMaxGeneratedPPNodeCount;
+
+       /** @var int Maximum recursion depth in PPFrame::expand() */
+       protected $mMaxPPExpandDepth;
+
+       /** @var int Maximum recursion depth for templates within templates */
+       protected $mMaxTemplateDepth;
+
+       /** @var int Maximum number of calls per parse to expensive parser 
functions */
+       protected $mExpensiveParserFunctionLimit;
+
+       /** @var bool Remove HTML comments. ONLY APPLIES TO PREPROCESS 
OPERATIONS */
+       protected $mRemoveComments = true;
+
+       /** @var array Callback for template fetching. Used as first argument 
to call_user_func(). */
+       protected $mTemplateCallback = array( 'Parser', 
'statelessFetchTemplate' );
+
+       /** @var bool Enable limit report in an HTML comment on output */
+       protected $mEnableLimitReport = false;
+
+       /** @var string Timestamp used for {{CURRENTDAY}} etc. */
+       protected $mTimestamp;
+
+       /** @var bool|string Target attribute for external links */
+       protected $mExternalLinkTarget;
 
        /**
-        * Allow external images inline?
-        */
-       var $mAllowExternalImages;
-
-       /**
-        * If not, any exception?
-        */
-       var $mAllowExternalImagesFrom;
-
-       /**
-        * If not or it doesn't match, should we check an on-wiki whitelist?
-        */
-       var $mEnableImageWhitelist;
-
-       /**
-        * Date format index
-        */
-       var $mDateFormat = null;
-
-       /**
-        * Create "edit section" links?
-        */
-       var $mEditSection = true;
-
-       /**
-        * Allow inclusion of special pages?
-        */
-       var $mAllowSpecialInclusion;
-
-       /**
-        * Use tidy to cleanup output HTML?
-        */
-       var $mTidy = false;
-
-       /**
-        * Which lang to call for PLURAL and GRAMMAR
-        */
-       var $mInterfaceMessage = false;
-
-       /**
-        * Overrides $mInterfaceMessage with arbitrary language
-        */
-       var $mTargetLanguage = null;
-
-       /**
-        * Maximum size of template expansions, in bytes
-        */
-       var $mMaxIncludeSize;
-
-       /**
-        * Maximum number of nodes touched by PPFrame::expand()
-        */
-       var $mMaxPPNodeCount;
-
-       /**
-        * Maximum number of nodes generated by Preprocessor::preprocessToObj()
-        */
-       var $mMaxGeneratedPPNodeCount;
-
-       /**
-        * Maximum recursion depth in PPFrame::expand()
-        */
-       var $mMaxPPExpandDepth;
-
-       /**
-        * Maximum recursion depth for templates within templates
-        */
-       var $mMaxTemplateDepth;
-
-       /**
-        * Maximum number of calls per parse to expensive parser functions
-        */
-       var $mExpensiveParserFunctionLimit;
-
-       /**
-        * Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS
-        */
-       var $mRemoveComments = true;
-
-       /**
-        * Callback for template fetching. Used as first argument to 
call_user_func().
-        */
-       var $mTemplateCallback =
-               array( 'Parser', 'statelessFetchTemplate' );
-
-       /**
-        * Enable limit report in an HTML comment on output
-        */
-       var $mEnableLimitReport = false;
-
-       /**
-        * Timestamp used for {{CURRENTDAY}} etc.
-        */
-       var $mTimestamp;
-
-       /**
-        * Target attribute for external links
-        */
-       var $mExternalLinkTarget;
-
-       /**
-        * Clean up signature texts?
+        * @var bool Clean up signature texts?
         *
         * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures
         * 2) Substitute all transclusions
         */
-       var $mCleanSignatures;
+       protected $mCleanSignatures;
 
-       /**
-        * Transform wiki markup when saving the page?
-        */
-       var $mPreSaveTransform = true;
+       /** @var bool Transform wiki markup when saving the page? */
+       protected $mPreSaveTransform = true;
 
-       /**
-        * Whether content conversion should be disabled
-        */
-       var $mDisableContentConversion;
+       /** @var bool Whether content conversion should be disabled */
+       protected $mDisableContentConversion;
 
-       /**
-        * Whether title conversion should be disabled
-        */
-       var $mDisableTitleConversion;
+       /** @var bool Whether title conversion should be disabled */
+       protected $mDisableTitleConversion;
 
-       /**
-        * Automatically number headings?
-        */
-       var $mNumberHeadings;
+       /** @var string Automatically number headings? */
+       protected $mNumberHeadings;
 
-       /**
-        * Thumb size preferred by the user.
-        */
-       var $mThumbSize;
+       /** @var string Thumb size preferred by the user. */
+       protected $mThumbSize;
 
-       /**
-        * Maximum article size of an article to be marked as "stub"
-        */
-       private $mStubThreshold;
+       /** @var Language Language object of the User language. */
+       protected $mUserLang;
 
-       /**
-        * Language object of the User language.
-        */
-       var $mUserLang;
+       /** @var User Stored user object */
+       protected $mUser;
 
-       /**
-        * @var User
-        * Stored user object
-        */
-       var $mUser;
+       /** @var bool Parsing the page for a "preview" operation on a single 
section? */
+       protected $mIsSectionPreview = false;
 
-       /**
-        * Parsing the page for a "preview" operation?
-        */
-       var $mIsPreview = false;
+       /** @var bool Parsing the printable version of the page? */
+       protected $mIsPrintable = false;
 
-       /**
-        * Parsing the page for a "preview" operation on a single section?
-        */
-       var $mIsSectionPreview = false;
+       /** @var string Extra key that should be present in the caching key. */
+       protected $mExtraKey = '';
 
-       /**
-        * Parsing the printable version of the page?
-        */
-       var $mIsPrintable = false;
-
-       /**
-        * Extra key that should be present in the caching key.
-        */
-       var $mExtraKey = '';
-
-       /**
-        * Function to be called when an option is accessed.
-        */
+       /** @var callable Function to be called when an option is accessed. */
        protected $onAccessCallback = null;
 
+       /** @var int Maximum article size of an article to be marked as "stub" 
*/
+       private $mStubThreshold;
+
        function getInterwikiMagic()                { return 
$this->mInterwikiMagic; }
        function getAllowExternalImages()           { return 
$this->mAllowExternalImages; }
        function getAllowExternalImagesFrom()       { return 
$this->mAllowExternalImagesFrom; }
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index b7cc490..324a2dd 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -22,40 +22,110 @@
  * @ingroup Parser
  */
 class ParserOutput extends CacheTime {
-       var $mText,                       # The output text
-               $mLanguageLinks,              # List of the full text of 
language links, in the order they appear
-               $mCategories,                 # Map of category names to sort 
keys
-               $mTitleText,                  # title text of the chosen 
language variant
-               $mLinks = array(),            # 2-D map of NS/DBK to ID for the 
links in the document. ID=zero for broken.
-               $mTemplates = array(),        # 2-D map of NS/DBK to ID for the 
template references. ID=zero for broken.
-               $mTemplateIds = array(),      # 2-D map of NS/DBK to rev ID for 
the template references. ID=zero for broken.
-               $mImages = array(),           # DB keys of the images used, in 
the array key only
-               $mFileSearchOptions = array(), # DB keys of the images used 
mapped to sha1 and MW timestamp
-               $mExternalLinks = array(),    # External link URLs, in the key 
only
-               $mInterwikiLinks = array(),   # 2-D map of prefix/DBK (in keys 
only) for the inline interwiki links in the document.
-               $mNewSection = false,         # Show a new section link?
-               $mHideNewSection = false,     # Hide the new section link?
-               $mNoGallery = false,          # No gallery on category page? 
(__NOGALLERY__)
-               $mHeadItems = array(),        # Items to put in the <head> 
section
-               $mModules = array(),          # Modules to be loaded by the 
resource loader
-               $mModuleScripts = array(),    # Modules of which only the JS 
will be loaded by the resource loader
-               $mModuleStyles = array(),     # Modules of which only the CSSS 
will be loaded by the resource loader
-               $mModuleMessages = array(),   # Modules of which only the 
messages will be loaded by the resource loader
-               $mJsConfigVars = array(),     # JavaScript config variable for 
mw.config combined with this page
-               $mOutputHooks = array(),      # Hook tags as per 
$wgParserOutputHooks
-               $mWarnings = array(),         # Warning text to be returned to 
the user. Wikitext formatted, in the key only
-               $mSections = array(),         # Table of contents
-               $mEditSectionTokens = false,  # prefix/suffix markers if edit 
sections were output as tokens
-               $mProperties = array(),       # Name/value pairs to be cached 
in the DB
-               $mTOCHTML = '',               # HTML of the TOC
-               $mTimestamp,                  # Timestamp of the revision
-               $mTOCEnabled = true;          # Whether TOC should be shown, 
can't override __NOTOC__
-               private $mIndexPolicy = '';       # 'index' or 'noindex'?  Any 
other value will result in no change.
-               private $mAccessedOptions = array(); # List of ParserOptions 
(stored in the keys)
-               private $mSecondaryDataUpdates = array(); # List of DataUpdate, 
used to save info from the page somewhere else.
-               private $mExtensionData = array(); # extra data used by 
extensions
-               private $mLimitReportData = array(); # Parser limit report data
-               private $mParseStartTime = array(); # Timestamps for 
getTimeSinceStart()
+       /** @var string The output text */
+       public $mText;
+
+       /** @var array List of the full text of language links; in the order 
they appear */
+       public $mLanguageLinks;
+
+       /** @var array Map of category names to sort keys */
+       public $mCategories;
+
+       /** @var array DB keys of the images used; in the array key only */
+       public $mImages = array();
+
+       /** @var array Modules to be loaded by the resource loader */
+       public $mModules = array();
+
+       /** @var array Name/value pairs to be cached in the DB */
+       public $mProperties = array();
+
+       /** @var string Title text of the chosen language variant */
+       protected $mTitleText;
+
+       /** @var array 2-D map of NS/DBK to ID for the links in the document. 
ID=zero for broken. */
+       protected $mLinks = array();
+
+       /** @var array 2-D map of NS/DBK to ID for the template references. 
ID=zero for broken. */
+       protected $mTemplates = array();
+
+       /** @var array 2-D map of NS/DBK to rev ID for the template references. 
ID=zero for broken. */
+       protected $mTemplateIds = array();
+
+       /** @var array DB keys of the images used mapped to sha1 and MW 
timestamp */
+       protected $mFileSearchOptions = array();
+
+       /** @var array External link URLs; in the key only */
+       protected $mExternalLinks = array();
+
+       /**
+        * @var array 2-D map of prefix/DBK (in keys only) for the inline 
interwiki
+        *   links in the document.
+        */
+       protected $mInterwikiLinks = array();
+
+       /** @var bool Show a new section link? */
+       protected $mNewSection = false;
+
+       /** @var bool Hide the new section link? */
+       protected $mHideNewSection = false;
+
+       /** @var bool No gallery on category page? (__NOGALLERY__) */
+       public $mNoGallery = false;
+
+       /** @var array Items to put in the <head> section */
+       protected $mHeadItems = array();
+
+       /** @var array Modules of which only the JS will be loaded by the 
resource loader */
+       protected $mModuleScripts = array();
+
+       /** @var array Modules of which only the CSSS will be loaded by the 
resource loader */
+       protected $mModuleStyles = array();
+
+       /** @var array Modules of which only the messages will be loaded by the 
resource loader */
+       protected $mModuleMessages = array();
+
+       /** @var array JavaScript config variable for mw.config combined with 
this page */
+       protected $mJsConfigVars = array();
+
+       /** @var array Hook tags as per $wgParserOutputHooks */
+       protected $mOutputHooks = array();
+
+       /** @var array Warning text to be returned to the user. Wikitext 
formatted; in the key only */
+       protected $mWarnings = array();
+
+       /** @var array Table of contents */
+       protected $mSections = array();
+
+       /** @var bool Prefix/suffix markers if edit sections were output as 
tokens */
+       protected $mEditSectionTokens = false;
+
+       /** @var string HTML of the TOC */
+       protected $mTOCHTML = '';
+
+       /** @var string Timestamp of the revision */
+       protected $mTimestamp;
+
+       /** @var bool Whether TOC should be shown, can't override __NOTOC__ */
+       protected $mTOCEnabled = true;
+
+       /** @var string 'index' or 'noindex'?  Any other value will result in 
no change. */
+       private $mIndexPolicy = '';
+
+       /** @var array List of ParserOptions (stored in the keys) */
+       private $mAccessedOptions = array();
+
+       /** @var array List of DataUpdate, used to save info from the page 
somewhere else. */
+       private $mSecondaryDataUpdates = array();
+
+       /** @var array Extra data used by extensions */
+       private $mExtensionData = array();
+
+       /** @var array Parser limit report data */
+       private $mLimitReportData = array();
+
+       /** @var array Timestamps for getTimeSinceStart() */
+       private $mParseStartTime = array();
 
        const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" 
section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
 
diff --git a/includes/parser/Parser_DiffTest.php 
b/includes/parser/Parser_DiffTest.php
index 920b6f6..4d821ca 100644
--- a/includes/parser/Parser_DiffTest.php
+++ b/includes/parser/Parser_DiffTest.php
@@ -24,12 +24,18 @@
 /**
  * @ingroup Parser
  */
-class Parser_DiffTest
-{
-       var $parsers, $conf;
-       var $shortOutput = false;
+class Parser_DiffTest {
+       /** @var array */
+       protected $parsers;
 
-       var $dtUniqPrefix;
+       /** @var array */
+       protected $conf;
+
+       /** @var bool */
+       protected $shortOutput = false;
+
+       /** @var string */
+       protected $dtUniqPrefix;
 
        function __construct( $conf ) {
                if ( !isset( $conf['parsers'] ) ) {
diff --git a/includes/parser/Preprocessor_DOM.php 
b/includes/parser/Preprocessor_DOM.php
index df3cbeb..c5f482d 100644
--- a/includes/parser/Preprocessor_DOM.php
+++ b/includes/parser/Preprocessor_DOM.php
@@ -25,13 +25,10 @@
  * @ingroup Parser
  */
 class Preprocessor_DOM implements Preprocessor {
+       /** @var Parser */
+       public $parser;
 
-       /**
-        * @var Parser
-        */
-       var $parser;
-
-       var $memoryLimit;
+       protected $memoryLimit;
 
        const CACHE_VERSION = 1;
 
@@ -736,16 +733,22 @@
  * @ingroup Parser
  */
 class PPDStack {
-       var $stack, $rootAccum;
+       /** @var array */
+       public $stack;
 
-       /**
-        * @var PPDStack
-        */
-       var $top;
-       var $out;
-       var $elementClass = 'PPDStackElement';
+       /** @var string */
+       public $rootAccum;
 
-       static $false = false;
+       /** @var bool|PPDStack */
+       public $top;
+
+       /** @var */
+       public $out;
+
+       /** @var string */
+       protected $elementClass = 'PPDStackElement';
+
+       protected static $false = false;
 
        function __construct() {
                $this->stack = array();
@@ -825,13 +828,26 @@
  * @ingroup Parser
  */
 class PPDStackElement {
-       var     $open,              // Opening character (\n for heading)
-               $close,             // Matching closing character
-               $count,             // Number of opening characters found 
(number of "=" for heading)
-               $parts,             // Array of PPDPart objects describing 
pipe-separated parts.
-               $lineStart;         // True if the open char appeared at the 
start of the input line. Not set for headings.
+       /** @var string Opening character (\n for heading) */
+       public $open;
 
-       var $partClass = 'PPDPart';
+       /** @var string Matching closing character */
+       public $close;
+
+       /** @var int Number of opening characters found (number of "=" for 
heading) */
+       public $count;
+
+       /** @var array PPDPart objects describing pipe-separated parts. */
+       public $parts;
+
+       /**
+        * @var bool True if the open char appeared at the start of the input 
line.
+        * Not set for headings.
+        */
+       public $lineStart;
+
+       /** @var string */
+       protected $partClass = 'PPDPart';
 
        function __construct( $data = array() ) {
                $class = $this->partClass;
@@ -899,7 +915,8 @@
  * @ingroup Parser
  */
 class PPDPart {
-       var $out; // Output accumulator string
+       /** @var string */
+       public $out;
 
        // Optional member variables:
        //   eqpos        Position of equals sign in output accumulator
@@ -916,34 +933,29 @@
  * @ingroup Parser
  */
 class PPFrame_DOM implements PPFrame {
+       /** @var array */
+       public $titleCache;
 
        /**
-        * @var Preprocessor
+        * @var array Hashtable listing templates which are disallowed for 
expansion
+        *   in this frame, having been encountered previously in parent frames.
         */
-       var $preprocessor;
+       public $loopCheckHash;
 
        /**
-        * @var Parser
-        */
-       var $parser;
-
-       /**
-        * @var Title
-        */
-       var $title;
-       var $titleCache;
-
-       /**
-        * Hashtable listing templates which are disallowed for expansion in 
this frame,
-        * having been encountered previously in parent frames.
-        */
-       var $loopCheckHash;
-
-       /**
-        * Recursion depth of this frame, top = 0
+        * @var int Recursion depth of this frame, top = 0.
         * Note that this is NOT the same as expansion depth in expand()
         */
-       var $depth;
+       public $depth;
+
+       /** @var Preprocessor */
+       protected $preprocessor;
+
+       /** @var Parser */
+       protected $parser;
+
+       /** @var Title */
+       protected $title;
 
        /**
         * Construct a new preprocessor frame.
@@ -1433,13 +1445,20 @@
  * @ingroup Parser
  */
 class PPTemplateFrame_DOM extends PPFrame_DOM {
-       var $numberedArgs, $namedArgs;
+       /** @var PPFrame_DOM */
+       public $parent;
 
-       /**
-        * @var PPFrame_DOM
-        */
-       var $parent;
-       var $numberedExpansionCache, $namedExpansionCache;
+       /** @var array */
+       protected $numberedArgs;
+
+       /** @var array */
+       protected $namedArgs;
+
+       /** @var array */
+       protected $numberedExpansionCache;
+
+       /** @var string[] */
+       protected $namedExpansionCache;
 
        /**
         * @param Preprocessor $preprocessor
@@ -1564,7 +1583,7 @@
  * @ingroup Parser
  */
 class PPCustomFrame_DOM extends PPFrame_DOM {
-       var $args;
+       protected $args;
 
        function __construct( $preprocessor, $args ) {
                parent::__construct( $preprocessor );
@@ -1610,12 +1629,11 @@
  * @ingroup Parser
  */
 class PPNode_DOM implements PPNode {
+       /** @var DOMElement */
+       public $node;
 
-       /**
-        * @var DOMElement
-        */
-       var $node;
-       var $xpath;
+       /** @var DOMXPath */
+       protected $xpath;
 
        function __construct( $node, $xpath = false ) {
                $this->node = $node;
diff --git a/includes/parser/Preprocessor_Hash.php 
b/includes/parser/Preprocessor_Hash.php
index aebb98e..2757766 100644
--- a/includes/parser/Preprocessor_Hash.php
+++ b/includes/parser/Preprocessor_Hash.php
@@ -28,10 +28,8 @@
  * @ingroup Parser
  */
 class Preprocessor_Hash implements Preprocessor {
-       /**
-        * @var Parser
-        */
-       var $parser;
+       /** @var Parser */
+       public $parser;
 
        const CACHE_VERSION = 1;
 
@@ -805,7 +803,9 @@
  * @ingroup Parser
  */
 class PPDAccum_Hash {
-       var $firstNode, $lastNode;
+       public $firstNode;
+
+       public $lastNode;
 
        function __construct() {
                $this->firstNode = $this->lastNode = false;
@@ -873,34 +873,30 @@
  * @ingroup Parser
  */
 class PPFrame_Hash implements PPFrame {
-
        /**
-        * @var Parser
-        */
-       var $parser;
-
-       /**
-        * @var Preprocessor
-        */
-       var $preprocessor;
-
-       /**
-        * @var Title
-        */
-       var $title;
-       var $titleCache;
-
-       /**
-        * Hashtable listing templates which are disallowed for expansion in 
this frame,
-        * having been encountered previously in parent frames.
-        */
-       var $loopCheckHash;
-
-       /**
-        * Recursion depth of this frame, top = 0
+        * @var int Recursion depth of this frame, top = 0
         * Note that this is NOT the same as expansion depth in expand()
         */
-       var $depth;
+       public $depth;
+
+       /** @var Parser */
+       protected $parser;
+
+       /** @var Preprocessor */
+       protected $preprocessor;
+
+       /** @var Title */
+       protected $title;
+
+       /** @var array */
+       protected $titleCache;
+
+       /**
+        * @var array Hashtable listing templates which are disallowed for
+        *   expansion in this frame, having been encountered previously in
+        *   parent frames.
+        */
+       protected $loopCheckHash;
 
        /**
         * Construct a new preprocessor frame.
@@ -1351,8 +1347,20 @@
  * @ingroup Parser
  */
 class PPTemplateFrame_Hash extends PPFrame_Hash {
-       var $numberedArgs, $namedArgs, $parent;
-       var $numberedExpansionCache, $namedExpansionCache;
+       /** @var array */
+       protected $numberedArgs;
+
+       /** @var array */
+       protected $namedArgs;
+
+       /** @var bool|PPFrame */
+       protected $parent;
+
+       /** @var array */
+       protected $numberedExpansionCache;
+
+       /** @var  */
+       protected $namedExpansionCache;
 
        /**
         * @param Preprocessor $preprocessor
@@ -1498,7 +1506,8 @@
  * @ingroup Parser
  */
 class PPCustomFrame_Hash extends PPFrame_Hash {
-       var $args;
+       /** @var array */
+       protected $args;
 
        function __construct( $preprocessor, $args ) {
                parent::__construct( $preprocessor );
@@ -1548,7 +1557,13 @@
  * @ingroup Parser
  */
 class PPNode_Hash_Tree implements PPNode {
-       var $name, $firstChild, $lastChild, $nextSibling;
+       public $name;
+
+       public $firstChild;
+
+       public $lastChild;
+
+       public $nextSibling;
 
        function __construct( $name ) {
                $this->name = $name;
@@ -1770,7 +1785,9 @@
  * @ingroup Parser
  */
 class PPNode_Hash_Text implements PPNode {
-       var $value, $nextSibling;
+       public $value;
+
+       public $nextSibling;
 
        function __construct( $value ) {
                if ( is_object( $value ) ) {
@@ -1802,7 +1819,9 @@
  * @ingroup Parser
  */
 class PPNode_Hash_Array implements PPNode {
-       var $value, $nextSibling;
+       public $value;
+
+       public $nextSibling;
 
        function __construct( $value ) {
                $this->value = $value;
@@ -1838,7 +1857,13 @@
  * @ingroup Parser
  */
 class PPNode_Hash_Attr implements PPNode {
-       var $name, $value, $nextSibling;
+       /** @var string */
+       public $name;
+
+       /** @var string */
+       public $value;
+
+       public $nextSibling;
 
        function __construct( $name, $value ) {
                $this->name = $name;

-- 
To view, visit https://gerrit.wikimedia.org/r/132746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If03a9bd5eb83be4d15f54e73f49f42540fb7d5fc
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Cscott <canan...@wikimedia.org>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to