From df983f664230754c507e1eb0f776201bd046ad78 Mon Sep 17 00:00:00 2001 From: "Ori.livneh" Date: Fri, 16 May 2014 00:48:01 +0000 Subject: [PATCH] Revert "Declare visibility on class properties of includes/parser/" See https://bugzilla.wikimedia.org/65375#c4 This reverts commit f359cdf61462782743a87943938ef4cce78b2647. Bug: 65375 Change-Id: I12a60b5cc52a07a6deabcbf47c7c99cd2faac3c3 --- includes/parser/CacheTime.php | 22 +-- includes/parser/DateFormatter.php | 37 +---- includes/parser/LinkHolderArray.php | 16 +- includes/parser/Parser.php | 230 ++++++++------------------ includes/parser/ParserOptions.php | 211 +++++++++++++++-------- includes/parser/ParserOutput.php | 138 ++++------------ includes/parser/Parser_DiffTest.php | 16 +- includes/parser/Preprocessor_DOM.php | 122 ++++++-------- includes/parser/Preprocessor_Hash.php | 89 ++++------ 9 files changed, 339 insertions(+), 542 deletions(-) diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php index 91f404acc2..6fb3e0a820 100644 --- a/includes/parser/CacheTime.php +++ b/includes/parser/CacheTime.php @@ -32,23 +32,11 @@ class CacheTime { */ public $mUsedOptions; - /** @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; + 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 /** * @return string TS_MW timestamp diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index f022646765..cfd53702fa 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -27,40 +27,11 @@ * @ingroup Parser */ class DateFormatter { - protected $mSource; + var $mSource, $mTarget; + var $monthNames = '', $rxDM, $rxMD, $rxDMY, $rxYDM, $rxMDY, $rxYMD; - 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; + var $regexes, $pDays, $pMonths, $pYears; + var $rules, $xMonths, $preferences; protected $lang; diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index fd84265f3c..854634896a 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -25,19 +25,9 @@ * @ingroup Parser */ class LinkHolderArray { - /** @var array */ - public $internals = array(); - - /** @var array */ - public $interwikis = array(); - - /** @var int */ - protected $size = 0; - - /** @var Parser */ - protected $parent; - - /** @var int */ + var $internals = array(), $interwikis = array(); + var $size = 0; + var $parent; protected $tempIdOffset; function __construct( $parent ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ef6c079206..b8f26facfe 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -119,203 +119,103 @@ class Parser { const TOC_START = ''; const TOC_END = ''; - # Persistent + # 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; - /** @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(); + # Initialised by initialiseVariables() /** - * @var array - * @todo Unused? + * @var MagicWordArray */ - 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 */ - public $mVariables; - - /** @var MagicWordArray */ - protected $mSubstWords; - - # Initialised in constructor + var $mVariables; - /** @var array */ - protected $mConf; - - /** @var Parser */ - public $mPreprocessor; - - /** @var string */ - protected $mExtLinkBracketedRegex; - - /** @var string */ - protected $mUrlProtocols; + /** + * @var MagicWordArray + */ + var $mSubstWords; + var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor # Cleared with clearState(): - - /** @var ParserOutput */ - public $mOutput; - - /** @var int */ - protected $mAutonumber; - - /** @var bool */ - protected $mDTopen; - - /** @var StripState */ - public $mStripState; - /** - * @var array - * @todo Unused? + * @var ParserOutput */ - private $mIncludeCount; + var $mOutput; + var $mAutonumber, $mDTopen; /** - * @var bool - * @todo Unused? + * @var StripState */ - 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 $mStripState; - /** @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 $mIncludeCount, $mArgStack, $mLastSection, $mInPre; + /** + * @var LinkHolderArray + */ + var $mLinkHolders; - /** @var bool */ - protected $mForceTocPosition; + 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; - /** @var User User object; only used when doing pre-save transform */ - protected $mUser; + /** + * @var User + */ + var $mUser; # User object; only used when doing pre-save transform # Temporary # These are variables reset at least once per parse regardless of $clearState - /** @var ParserOptions */ - public $mOptions; - - /** @var Title Title context, used for self-link rendering and similar things */ - public $mTitle; - - /** @var array Shortcut alias, see setOutputType() */ - public $ot; - - /** @var string The timestamp of the specified revision ID */ - public $mRevisionTimestamp; - - /** @var string */ - public $mUniqPrefix; - /** - * @var boolean Recursive call protection. - * This variable should be treated as if it were private. + * @var ParserOptions */ - 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 $mOptions; - /** @var string User to display in {{REVISIONUSER}} tag */ - protected $mRevisionUser; - - /** @var int Size to display in {{REVISIONSIZE}} variable */ - protected $mRevisionSize; + /** + * @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 bool|int For {{PAGESIZE}} on current page. */ - protected $mInputSize = false; + /** + * @var string + */ + var $mUniqPrefix; /** * @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 $mLangLinkLanguages; /** - * @var int The revision ID which was used to fetch the timestamp - * @todo Unused? + * @var boolean Recursive call protection. + * This variable should be treated as if it were private. */ - private $mRevIdForTs; + public $mInParse = false; /** * @param array $conf diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index efd5f7436e..fa73cf29d2 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -30,119 +30,186 @@ * @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; + /** + * Interlanguage links are removed and returned in an array + */ + var $mInterwikiMagic; - /** @var bool Allow external images inline? */ - protected $mAllowExternalImages; + /** + * Allow external images inline? + */ + var $mAllowExternalImages; - /** @var string|array If not, any exception? */ - protected $mAllowExternalImagesFrom; + /** + * If not, any exception? + */ + var $mAllowExternalImagesFrom; - /** @var bool If not or it doesn't match, should we check an on-wiki whitelist? */ - protected $mEnableImageWhitelist; + /** + * If not or it doesn't match, should we check an on-wiki whitelist? + */ + var $mEnableImageWhitelist; - /** @var string Date format index */ - protected $mDateFormat = null; + /** + * Date format index + */ + var $mDateFormat = null; - /** @var bool Create "edit section" links? */ - protected $mEditSection = true; + /** + * Create "edit section" links? + */ + var $mEditSection = true; - /** @var bool Allow inclusion of special pages? */ - protected $mAllowSpecialInclusion; + /** + * Allow inclusion of special pages? + */ + var $mAllowSpecialInclusion; - /** @var bool Use tidy to cleanup output HTML? */ - protected $mTidy = false; + /** + * Use tidy to cleanup output HTML? + */ + var $mTidy = false; /** - * @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. + * Which lang to call for PLURAL and GRAMMAR */ - protected $mInterfaceMessage = false; + var $mInterfaceMessage = false; - /** @var string|Language Overrides $mInterfaceMessage with arbitrary language */ - protected $mTargetLanguage = null; + /** + * Overrides $mInterfaceMessage with arbitrary language + */ + var $mTargetLanguage = null; - /** @var int Maximum size of template expansions, in bytes */ - protected $mMaxIncludeSize; + /** + * Maximum size of template expansions, in bytes + */ + var $mMaxIncludeSize; - /** @var int Maximum number of nodes touched by PPFrame::expand() */ - protected $mMaxPPNodeCount; + /** + * Maximum number of nodes touched by PPFrame::expand() + */ + var $mMaxPPNodeCount; - /** @var int Maximum number of nodes generated by Preprocessor::preprocessToObj() */ - protected $mMaxGeneratedPPNodeCount; + /** + * Maximum number of nodes generated by Preprocessor::preprocessToObj() + */ + var $mMaxGeneratedPPNodeCount; - /** @var int Maximum recursion depth in PPFrame::expand() */ - protected $mMaxPPExpandDepth; + /** + * Maximum recursion depth in PPFrame::expand() + */ + var $mMaxPPExpandDepth; - /** @var int Maximum recursion depth for templates within templates */ - protected $mMaxTemplateDepth; + /** + * Maximum recursion depth for templates within templates + */ + var $mMaxTemplateDepth; - /** @var int Maximum number of calls per parse to expensive parser functions */ - protected $mExpensiveParserFunctionLimit; + /** + * Maximum number of calls per parse to expensive parser functions + */ + var $mExpensiveParserFunctionLimit; - /** @var bool Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS */ - protected $mRemoveComments = true; + /** + * Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS + */ + var $mRemoveComments = true; - /** @var array Callback for template fetching. Used as first argument to call_user_func(). */ - protected $mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' ); + /** + * Callback for template fetching. Used as first argument to call_user_func(). + */ + var $mTemplateCallback = + array( 'Parser', 'statelessFetchTemplate' ); - /** @var bool Enable limit report in an HTML comment on output */ - protected $mEnableLimitReport = false; + /** + * Enable limit report in an HTML comment on output + */ + var $mEnableLimitReport = false; - /** @var string Timestamp used for {{CURRENTDAY}} etc. */ - protected $mTimestamp; + /** + * Timestamp used for {{CURRENTDAY}} etc. + */ + var $mTimestamp; - /** @var bool|string Target attribute for external links */ - protected $mExternalLinkTarget; + /** + * Target attribute for external links + */ + var $mExternalLinkTarget; /** - * @var bool Clean up signature texts? + * Clean up signature texts? * * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures * 2) Substitute all transclusions */ - protected $mCleanSignatures; + var $mCleanSignatures; - /** @var bool Transform wiki markup when saving the page? */ - protected $mPreSaveTransform = true; + /** + * Transform wiki markup when saving the page? + */ + var $mPreSaveTransform = true; - /** @var bool Whether content conversion should be disabled */ - protected $mDisableContentConversion; + /** + * Whether content conversion should be disabled + */ + var $mDisableContentConversion; - /** @var bool Whether title conversion should be disabled */ - protected $mDisableTitleConversion; + /** + * Whether title conversion should be disabled + */ + var $mDisableTitleConversion; - /** @var string Automatically number headings? */ - protected $mNumberHeadings; + /** + * Automatically number headings? + */ + var $mNumberHeadings; - /** @var string Thumb size preferred by the user. */ - protected $mThumbSize; + /** + * Thumb size preferred by the user. + */ + var $mThumbSize; - /** @var Language Language object of the User language. */ - protected $mUserLang; + /** + * Maximum article size of an article to be marked as "stub" + */ + private $mStubThreshold; - /** @var User Stored user object */ - protected $mUser; + /** + * Language object of the User language. + */ + var $mUserLang; - /** @var bool Parsing the page for a "preview" operation on a single section? */ - protected $mIsSectionPreview = false; + /** + * @var User + * Stored user object + */ + var $mUser; - /** @var bool Parsing the printable version of the page? */ - protected $mIsPrintable = false; + /** + * Parsing the page for a "preview" operation? + */ + var $mIsPreview = false; - /** @var string Extra key that should be present in the caching key. */ - protected $mExtraKey = ''; + /** + * Parsing the page for a "preview" operation on a single section? + */ + var $mIsSectionPreview = false; - /** @var callable Function to be called when an option is accessed. */ - protected $onAccessCallback = null; + /** + * Parsing the printable version of the page? + */ + var $mIsPrintable = false; - /** @var int Maximum article size of an article to be marked as "stub" */ - private $mStubThreshold; + /** + * Extra key that should be present in the caching key. + */ + var $mExtraKey = ''; + + /** + * Function to be called when an option is accessed. + */ + protected $onAccessCallback = null; function getInterwikiMagic() { return $this->mInterwikiMagic; diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 74ce3257f0..931c08832c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -22,110 +22,40 @@ * @ingroup Parser */ class ParserOutput extends CacheTime { - /** @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 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(); + 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 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() const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)())#'; diff --git a/includes/parser/Parser_DiffTest.php b/includes/parser/Parser_DiffTest.php index 4d821cada5..920b6f6621 100644 --- a/includes/parser/Parser_DiffTest.php +++ b/includes/parser/Parser_DiffTest.php @@ -24,18 +24,12 @@ /** * @ingroup Parser */ -class Parser_DiffTest { - /** @var array */ - protected $parsers; +class Parser_DiffTest +{ + var $parsers, $conf; + var $shortOutput = false; - /** @var array */ - protected $conf; - - /** @var bool */ - protected $shortOutput = false; - - /** @var string */ - protected $dtUniqPrefix; + var $dtUniqPrefix; function __construct( $conf ) { if ( !isset( $conf['parsers'] ) ) { diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 7d8a0b6818..0d12205580 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -25,10 +25,13 @@ * @ingroup Parser */ class Preprocessor_DOM implements Preprocessor { - /** @var Parser */ - public $parser; - protected $memoryLimit; + /** + * @var Parser + */ + var $parser; + + var $memoryLimit; const CACHE_VERSION = 1; @@ -769,22 +772,16 @@ class Preprocessor_DOM implements Preprocessor { * @ingroup Parser */ class PPDStack { - /** @var array */ - public $stack; - - /** @var string */ - public $rootAccum; + var $stack, $rootAccum; - /** @var bool|PPDStack */ - public $top; - - /** @var */ - public $out; - - /** @var string */ - protected $elementClass = 'PPDStackElement'; + /** + * @var PPDStack + */ + var $top; + var $out; + var $elementClass = 'PPDStackElement'; - protected static $false = false; + static $false = false; function __construct() { $this->stack = array(); @@ -864,26 +861,13 @@ class PPDStack { * @ingroup Parser */ class PPDStackElement { - /** @var string Opening character (\n for heading) */ - public $open; + 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 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'; + var $partClass = 'PPDPart'; function __construct( $data = array() ) { $class = $this->partClass; @@ -952,8 +936,7 @@ class PPDStackElement { * @ingroup Parser */ class PPDPart { - /** @var string */ - public $out; + var $out; // Output accumulator string // Optional member variables: // eqpos Position of equals sign in output accumulator @@ -970,29 +953,34 @@ class PPDPart { * @ingroup Parser */ class PPFrame_DOM implements PPFrame { - /** @var array */ - public $titleCache; /** - * @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 $preprocessor; /** - * @var int Recursion depth of this frame, top = 0. - * Note that this is NOT the same as expansion depth in expand() + * @var Parser */ - public $depth; + var $parser; - /** @var Preprocessor */ - protected $preprocessor; + /** + * @var Title + */ + var $title; + var $titleCache; - /** @var Parser */ - protected $parser; + /** + * Hashtable listing templates which are disallowed for expansion in this frame, + * having been encountered previously in parent frames. + */ + var $loopCheckHash; - /** @var Title */ - protected $title; + /** + * Recursion depth of this frame, top = 0 + * Note that this is NOT the same as expansion depth in expand() + */ + var $depth; /** * Construct a new preprocessor frame. @@ -1485,20 +1473,13 @@ class PPFrame_DOM implements PPFrame { * @ingroup Parser */ class PPTemplateFrame_DOM extends PPFrame_DOM { - /** @var PPFrame_DOM */ - public $parent; + var $numberedArgs, $namedArgs; - /** @var array */ - protected $numberedArgs; - - /** @var array */ - protected $namedArgs; - - /** @var array */ - protected $numberedExpansionCache; - - /** @var string[] */ - protected $namedExpansionCache; + /** + * @var PPFrame_DOM + */ + var $parent; + var $numberedExpansionCache, $namedExpansionCache; /** * @param Preprocessor $preprocessor @@ -1628,7 +1609,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM { * @ingroup Parser */ class PPCustomFrame_DOM extends PPFrame_DOM { - protected $args; + var $args; function __construct( $preprocessor, $args ) { parent::__construct( $preprocessor ); @@ -1674,11 +1655,12 @@ class PPCustomFrame_DOM extends PPFrame_DOM { * @ingroup Parser */ class PPNode_DOM implements PPNode { - /** @var DOMElement */ - public $node; - /** @var DOMXPath */ - protected $xpath; + /** + * @var DOMElement + */ + var $node; + var $xpath; function __construct( $node, $xpath = false ) { $this->node = $node; diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index a5b6b43e9e..a464461165 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -28,8 +28,10 @@ * @ingroup Parser */ class Preprocessor_Hash implements Preprocessor { - /** @var Parser */ - public $parser; + /** + * @var Parser + */ + var $parser; const CACHE_VERSION = 1; @@ -820,9 +822,7 @@ class PPDPart_Hash extends PPDPart { * @ingroup Parser */ class PPDAccum_Hash { - public $firstNode; - - public $lastNode; + var $firstNode, $lastNode; function __construct() { $this->firstNode = $this->lastNode = false; @@ -890,30 +890,34 @@ class PPDAccum_Hash { * @ingroup Parser */ class PPFrame_Hash implements PPFrame { + /** - * @var int Recursion depth of this frame, top = 0 - * Note that this is NOT the same as expansion depth in expand() + * @var Parser */ - public $depth; - - /** @var Parser */ - protected $parser; + var $parser; - /** @var Preprocessor */ - protected $preprocessor; + /** + * @var Preprocessor + */ + var $preprocessor; - /** @var Title */ - protected $title; + /** + * @var Title + */ + var $title; + var $titleCache; - /** @var array */ - protected $titleCache; + /** + * Hashtable listing templates which are disallowed for expansion in this frame, + * having been encountered previously in parent frames. + */ + var $loopCheckHash; /** - * @var array Hashtable listing templates which are disallowed for - * expansion in this frame, having been encountered previously in - * parent frames. + * Recursion depth of this frame, top = 0 + * Note that this is NOT the same as expansion depth in expand() */ - protected $loopCheckHash; + var $depth; /** * Construct a new preprocessor frame. @@ -1375,20 +1379,8 @@ class PPFrame_Hash implements PPFrame { * @ingroup Parser */ class PPTemplateFrame_Hash extends PPFrame_Hash { - /** @var array */ - protected $numberedArgs; - - /** @var array */ - protected $namedArgs; - - /** @var bool|PPFrame */ - protected $parent; - - /** @var array */ - protected $numberedExpansionCache; - - /** @var */ - protected $namedExpansionCache; + var $numberedArgs, $namedArgs, $parent; + var $numberedExpansionCache, $namedExpansionCache; /** * @param Preprocessor $preprocessor @@ -1539,8 +1531,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash { * @ingroup Parser */ class PPCustomFrame_Hash extends PPFrame_Hash { - /** @var array */ - protected $args; + var $args; function __construct( $preprocessor, $args ) { parent::__construct( $preprocessor ); @@ -1590,13 +1581,7 @@ class PPCustomFrame_Hash extends PPFrame_Hash { * @ingroup Parser */ class PPNode_Hash_Tree implements PPNode { - public $name; - - public $firstChild; - - public $lastChild; - - public $nextSibling; + var $name, $firstChild, $lastChild, $nextSibling; function __construct( $name ) { $this->name = $name; @@ -1818,9 +1803,7 @@ class PPNode_Hash_Tree implements PPNode { * @ingroup Parser */ class PPNode_Hash_Text implements PPNode { - public $value; - - public $nextSibling; + var $value, $nextSibling; function __construct( $value ) { if ( is_object( $value ) ) { @@ -1878,9 +1861,7 @@ class PPNode_Hash_Text implements PPNode { * @ingroup Parser */ class PPNode_Hash_Array implements PPNode { - public $value; - - public $nextSibling; + var $value, $nextSibling; function __construct( $value ) { $this->value = $value; @@ -1935,13 +1916,7 @@ class PPNode_Hash_Array implements PPNode { * @ingroup Parser */ class PPNode_Hash_Attr implements PPNode { - /** @var string */ - public $name; - - /** @var string */ - public $value; - - public $nextSibling; + var $name, $value, $nextSibling; function __construct( $name, $value ) { $this->name = $name; -- 2.20.1