aboutsummaryrefslogtreecommitdiffstats
path: root/includes/parser
diff options
context:
space:
mode:
Diffstat (limited to 'includes/parser')
-rw-r--r--includes/parser/CacheTime.php20
-rw-r--r--includes/parser/CoreParserFunctions.php129
-rw-r--r--includes/parser/CoreTagHooks.php10
-rw-r--r--includes/parser/DateFormatter.php24
-rw-r--r--includes/parser/LinkHolderArray.php33
-rw-r--r--includes/parser/MWTidy.php2
-rw-r--r--includes/parser/Parser.php264
-rw-r--r--includes/parser/ParserCache.php2
-rw-r--r--includes/parser/ParserDiffTest.php20
-rw-r--r--includes/parser/ParserOptions.php202
-rw-r--r--includes/parser/ParserOutput.php120
-rw-r--r--includes/parser/Preprocessor.php68
-rw-r--r--includes/parser/Preprocessor_DOM.php194
-rw-r--r--includes/parser/Preprocessor_Hash.php241
-rw-r--r--includes/parser/StripState.php18
15 files changed, 675 insertions, 672 deletions
diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php
index 6fb3e0a82018..94abc2660940 100644
--- a/includes/parser/CacheTime.php
+++ b/includes/parser/CacheTime.php
@@ -32,7 +32,7 @@ class CacheTime {
*/
public $mUsedOptions;
- var $mVersion = Parser::VERSION, # Compatibility check
+ public $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}}
@@ -41,14 +41,14 @@ class CacheTime {
/**
* @return string TS_MW timestamp
*/
- function getCacheTime() {
+ public function getCacheTime() {
return wfTimestamp( TS_MW, $this->mCacheTime );
}
/**
* @return bool
*/
- function containsOldMagic() {
+ public function containsOldMagic() {
return $this->mContainsOldMagic;
}
@@ -56,7 +56,7 @@ class CacheTime {
* @param bool $com
* @return bool
*/
- function setContainsOldMagic( $com ) {
+ public function setContainsOldMagic( $com ) {
return wfSetVar( $this->mContainsOldMagic, $com );
}
@@ -66,7 +66,7 @@ class CacheTime {
* @param string $t
* @return string
*/
- function setCacheTime( $t ) {
+ public function setCacheTime( $t ) {
return wfSetVar( $this->mCacheTime, $t );
}
@@ -74,7 +74,7 @@ class CacheTime {
* @since 1.23
* @return int|null Revision id, if any was set
*/
- function getCacheRevisionId() {
+ public function getCacheRevisionId() {
return $this->mCacheRevisionId;
}
@@ -82,7 +82,7 @@ class CacheTime {
* @since 1.23
* @param int $id Revision id
*/
- function setCacheRevisionId( $id ) {
+ public function setCacheRevisionId( $id ) {
$this->mCacheRevisionId = $id;
}
@@ -96,7 +96,7 @@ class CacheTime {
*
* @param int $seconds
*/
- function updateCacheExpiry( $seconds ) {
+ public function updateCacheExpiry( $seconds ) {
$seconds = (int)$seconds;
if ( $this->mCacheExpiry === null || $this->mCacheExpiry > $seconds ) {
@@ -118,7 +118,7 @@ class CacheTime {
* value of $wgParserCacheExpireTime.
* @return int|mixed|null
*/
- function getCacheExpiry() {
+ public function getCacheExpiry() {
global $wgParserCacheExpireTime;
if ( $this->mCacheTime < 0 ) {
@@ -147,7 +147,7 @@ class CacheTime {
/**
* @return bool
*/
- function isCacheable() {
+ public function isCacheable() {
return $this->getCacheExpiry() > 0;
}
diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php
index 84e7fe2b540e..cd1f32dc4c7f 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -30,7 +30,7 @@ class CoreParserFunctions {
* @param Parser $parser
* @return void
*/
- static function register( $parser ) {
+ public static function register( $parser ) {
global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions;
# Syntax for arguments (see Parser::setFunctionHook):
@@ -84,7 +84,7 @@ class CoreParserFunctions {
* @param string $part1
* @return array
*/
- static function intFunction( $parser, $part1 = '' /*, ... */ ) {
+ public static function intFunction( $parser, $part1 = '' /*, ... */ ) {
if ( strval( $part1 ) !== '' ) {
$args = array_slice( func_get_args(), 2 );
$message = wfMessage( $part1, $args )
@@ -103,7 +103,7 @@ class CoreParserFunctions {
*
* @return string
*/
- static function formatDate( $parser, $date, $defaultPref = null ) {
+ public static function formatDate( $parser, $date, $defaultPref = null ) {
$lang = $parser->getFunctionLang();
$df = DateFormatter::getInstance( $lang );
@@ -121,7 +121,7 @@ class CoreParserFunctions {
return $date;
}
- static function ns( $parser, $part1 = '' ) {
+ public static function ns( $parser, $part1 = '' ) {
global $wgContLang;
if ( intval( $part1 ) || $part1 == "0" ) {
$index = intval( $part1 );
@@ -135,7 +135,7 @@ class CoreParserFunctions {
}
}
- static function nse( $parser, $part1 = '' ) {
+ public static function nse( $parser, $part1 = '' ) {
$ret = self::ns( $parser, $part1 );
if ( is_string( $ret ) ) {
$ret = wfUrlencode( str_replace( ' ', '_', $ret ) );
@@ -155,7 +155,7 @@ class CoreParserFunctions {
* @param string $arg (optional): The type of encoding.
* @return string
*/
- static function urlencode( $parser, $s = '', $arg = null ) {
+ public static function urlencode( $parser, $s = '', $arg = null ) {
static $magicWords = null;
if ( is_null( $magicWords ) ) {
$magicWords = new MagicWordArray( array( 'url_path', 'url_query', 'url_wiki' ) );
@@ -181,12 +181,12 @@ class CoreParserFunctions {
return $parser->markerSkipCallback( $s, $func );
}
- static function lcfirst( $parser, $s = '' ) {
+ public static function lcfirst( $parser, $s = '' ) {
global $wgContLang;
return $wgContLang->lcfirst( $s );
}
- static function ucfirst( $parser, $s = '' ) {
+ public static function ucfirst( $parser, $s = '' ) {
global $wgContLang;
return $wgContLang->ucfirst( $s );
}
@@ -196,7 +196,7 @@ class CoreParserFunctions {
* @param string $s
* @return string
*/
- static function lc( $parser, $s = '' ) {
+ public static function lc( $parser, $s = '' ) {
global $wgContLang;
return $parser->markerSkipCallback( $s, array( $wgContLang, 'lc' ) );
}
@@ -206,16 +206,16 @@ class CoreParserFunctions {
* @param string $s
* @return string
*/
- static function uc( $parser, $s = '' ) {
+ public static function uc( $parser, $s = '' ) {
global $wgContLang;
return $parser->markerSkipCallback( $s, array( $wgContLang, 'uc' ) );
}
- static function localurl( $parser, $s = '', $arg = null ) {
+ public static function localurl( $parser, $s = '', $arg = null ) {
return self::urlFunction( 'getLocalURL', $s, $arg );
}
- static function localurle( $parser, $s = '', $arg = null ) {
+ public static function localurle( $parser, $s = '', $arg = null ) {
$temp = self::urlFunction( 'getLocalURL', $s, $arg );
if ( !is_string( $temp ) ) {
return $temp;
@@ -224,11 +224,11 @@ class CoreParserFunctions {
}
}
- static function fullurl( $parser, $s = '', $arg = null ) {
+ public static function fullurl( $parser, $s = '', $arg = null ) {
return self::urlFunction( 'getFullURL', $s, $arg );
}
- static function fullurle( $parser, $s = '', $arg = null ) {
+ public static function fullurle( $parser, $s = '', $arg = null ) {
$temp = self::urlFunction( 'getFullURL', $s, $arg );
if ( !is_string( $temp ) ) {
return $temp;
@@ -237,11 +237,11 @@ class CoreParserFunctions {
}
}
- static function canonicalurl( $parser, $s = '', $arg = null ) {
+ public static function canonicalurl( $parser, $s = '', $arg = null ) {
return self::urlFunction( 'getCanonicalURL', $s, $arg );
}
- static function canonicalurle( $parser, $s = '', $arg = null ) {
+ public static function canonicalurle( $parser, $s = '', $arg = null ) {
$temp = self::urlFunction( 'getCanonicalURL', $s, $arg );
if ( !is_string( $temp ) ) {
return $temp;
@@ -250,7 +250,7 @@ class CoreParserFunctions {
}
}
- static function urlFunction( $func, $s = '', $arg = null ) {
+ public static function urlFunction( $func, $s = '', $arg = null ) {
$title = Title::newFromText( $s );
# Due to order of execution of a lot of bits, the values might be encoded
# before arriving here; if that's true, then the title can't be created
@@ -281,7 +281,7 @@ class CoreParserFunctions {
* @param string $arg
* @return string
*/
- static function formatnum( $parser, $num = '', $arg = null ) {
+ public static function formatnum( $parser, $num = '', $arg = null ) {
if ( self::matchAgainstMagicword( 'rawsuffix', $arg ) ) {
$func = array( $parser->getFunctionLang(), 'parseFormattedNumber' );
} elseif ( self::matchAgainstMagicword( 'nocommafysuffix', $arg ) ) {
@@ -298,7 +298,7 @@ class CoreParserFunctions {
* @param string $word
* @return string
*/
- static function grammar( $parser, $case = '', $word = '' ) {
+ public static function grammar( $parser, $case = '', $word = '' ) {
$word = $parser->killMarkers( $word );
return $parser->getFunctionLang()->convertGrammar( $word, $case );
}
@@ -308,7 +308,7 @@ class CoreParserFunctions {
* @param string $username
* @return string
*/
- static function gender( $parser, $username ) {
+ public static function gender( $parser, $username ) {
wfProfileIn( __METHOD__ );
$forms = array_slice( func_get_args(), 2 );
@@ -350,7 +350,7 @@ class CoreParserFunctions {
* @param string $text
* @return string
*/
- static function plural( $parser, $text = '' ) {
+ public static function plural( $parser, $text = '' ) {
$forms = array_slice( func_get_args(), 2 );
$text = $parser->getFunctionLang()->parseFormattedNumber( $text );
settype( $text, ctype_digit( $text ) ? 'int' : 'float' );
@@ -363,9 +363,10 @@ class CoreParserFunctions {
*
* @param Parser $parser Parent parser
* @param string $text Desired title text
+ * @param string $uarg
* @return string
*/
- static function displaytitle( $parser, $text = '', $uarg = '' ) {
+ public static function displaytitle( $parser, $text = '', $uarg = '' ) {
global $wgRestrictDisplayTitle;
static $magicWords = null;
@@ -459,7 +460,7 @@ class CoreParserFunctions {
return $mwObject->matchStartToEnd( $value );
}
- static function formatRaw( $num, $raw ) {
+ public static function formatRaw( $num, $raw ) {
if ( self::matchAgainstMagicword( 'rawsuffix', $raw ) ) {
return $num;
} else {
@@ -467,35 +468,35 @@ class CoreParserFunctions {
return $wgContLang->formatNum( $num );
}
}
- static function numberofpages( $parser, $raw = null ) {
+ public static function numberofpages( $parser, $raw = null ) {
return self::formatRaw( SiteStats::pages(), $raw );
}
- static function numberofusers( $parser, $raw = null ) {
+ public static function numberofusers( $parser, $raw = null ) {
return self::formatRaw( SiteStats::users(), $raw );
}
- static function numberofactiveusers( $parser, $raw = null ) {
+ public static function numberofactiveusers( $parser, $raw = null ) {
return self::formatRaw( SiteStats::activeUsers(), $raw );
}
- static function numberofarticles( $parser, $raw = null ) {
+ public static function numberofarticles( $parser, $raw = null ) {
return self::formatRaw( SiteStats::articles(), $raw );
}
- static function numberoffiles( $parser, $raw = null ) {
+ public static function numberoffiles( $parser, $raw = null ) {
return self::formatRaw( SiteStats::images(), $raw );
}
- static function numberofadmins( $parser, $raw = null ) {
+ public static function numberofadmins( $parser, $raw = null ) {
return self::formatRaw( SiteStats::numberingroup( 'sysop' ), $raw );
}
- static function numberofedits( $parser, $raw = null ) {
+ public static function numberofedits( $parser, $raw = null ) {
return self::formatRaw( SiteStats::edits(), $raw );
}
- static function numberofviews( $parser, $raw = null ) {
+ public static function numberofviews( $parser, $raw = null ) {
global $wgDisableCounters;
return !$wgDisableCounters ? self::formatRaw( SiteStats::views(), $raw ) : '';
}
- static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
+ public static function pagesinnamespace( $parser, $namespace = 0, $raw = null ) {
return self::formatRaw( SiteStats::pagesInNs( intval( $namespace ) ), $raw );
}
- static function numberingroup( $parser, $name = '', $raw = null ) {
+ public static function numberingroup( $parser, $name = '', $raw = null ) {
return self::formatRaw( SiteStats::numberingroup( strtolower( $name ) ), $raw );
}
@@ -508,49 +509,49 @@ class CoreParserFunctions {
* @param string $title
* @return mixed|string
*/
- static function mwnamespace( $parser, $title = null ) {
+ public static function mwnamespace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return str_replace( '_', ' ', $t->getNsText() );
}
- static function namespacee( $parser, $title = null ) {
+ public static function namespacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfUrlencode( $t->getNsText() );
}
- static function namespacenumber( $parser, $title = null ) {
+ public static function namespacenumber( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return $t->getNamespace();
}
- static function talkspace( $parser, $title = null ) {
+ public static function talkspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return str_replace( '_', ' ', $t->getTalkNsText() );
}
- static function talkspacee( $parser, $title = null ) {
+ public static function talkspacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return wfUrlencode( $t->getTalkNsText() );
}
- static function subjectspace( $parser, $title = null ) {
+ public static function subjectspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return str_replace( '_', ' ', $t->getSubjectNsText() );
}
- static function subjectspacee( $parser, $title = null ) {
+ public static function subjectspacee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
@@ -565,98 +566,98 @@ class CoreParserFunctions {
* @param string $title
* @return string
*/
- static function pagename( $parser, $title = null ) {
+ public static function pagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getText() );
}
- static function pagenamee( $parser, $title = null ) {
+ public static function pagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getPartialURL() );
}
- static function fullpagename( $parser, $title = null ) {
+ public static function fullpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return wfEscapeWikiText( $t->getPrefixedText() );
}
- static function fullpagenamee( $parser, $title = null ) {
+ public static function fullpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return wfEscapeWikiText( $t->getPrefixedURL() );
}
- static function subpagename( $parser, $title = null ) {
+ public static function subpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getSubpageText() );
}
- static function subpagenamee( $parser, $title = null ) {
+ public static function subpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getSubpageUrlForm() );
}
- static function rootpagename( $parser, $title = null ) {
+ public static function rootpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getRootText() );
}
- static function rootpagenamee( $parser, $title = null ) {
+ public static function rootpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( wfUrlEncode( str_replace( ' ', '_', $t->getRootText() ) ) );
}
- static function basepagename( $parser, $title = null ) {
+ public static function basepagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getBaseText() );
}
- static function basepagenamee( $parser, $title = null ) {
+ public static function basepagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( wfUrlEncode( str_replace( ' ', '_', $t->getBaseText() ) ) );
}
- static function talkpagename( $parser, $title = null ) {
+ public static function talkpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedText() );
}
- static function talkpagenamee( $parser, $title = null ) {
+ public static function talkpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() ) {
return '';
}
return wfEscapeWikiText( $t->getTalkPage()->getPrefixedURL() );
}
- static function subjectpagename( $parser, $title = null ) {
+ public static function subjectpagename( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
}
return wfEscapeWikiText( $t->getSubjectPage()->getPrefixedText() );
}
- static function subjectpagenamee( $parser, $title = null ) {
+ public static function subjectpagenamee( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) ) {
return '';
@@ -674,7 +675,7 @@ class CoreParserFunctions {
* @param string $arg2
* @return string
*/
- static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
+ public static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
global $wgContLang;
static $magicWords = null;
if ( is_null( $magicWords ) ) {
@@ -741,7 +742,7 @@ class CoreParserFunctions {
* @param string $raw Should number be human readable with commas or just number
* @return string
*/
- static function pagesize( $parser, $page = '', $raw = null ) {
+ public static function pagesize( $parser, $page = '', $raw = null ) {
$title = Title::newFromText( $page );
if ( !is_object( $title ) ) {
@@ -766,7 +767,7 @@ class CoreParserFunctions {
*
* @return string
*/
- static function protectionlevel( $parser, $type = '', $title = '' ) {
+ public static function protectionlevel( $parser, $type = '', $title = '' ) {
$titleObject = Title::newFromText( $title );
if ( !( $titleObject instanceof Title ) ) {
$titleObject = $parser->mTitle;
@@ -787,7 +788,7 @@ class CoreParserFunctions {
* @param string $inLanguage Language code (in which to get name)
* @return string
*/
- static function language( $parser, $code = '', $inLanguage = '' ) {
+ public static function language( $parser, $code = '', $inLanguage = '' ) {
$code = strtolower( $code );
$inLanguage = strtolower( $inLanguage );
$lang = Language::fetchLanguageName( $code, $inLanguage );
@@ -803,7 +804,7 @@ class CoreParserFunctions {
* @param int $direction
* @return string
*/
- static function pad( $parser, $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) {
+ public static function pad( $parser, $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) {
$padding = $parser->killMarkers( $padding );
$lengthOfPadding = mb_strlen( $padding );
if ( $lengthOfPadding == 0 ) {
@@ -829,11 +830,11 @@ class CoreParserFunctions {
}
}
- static function padleft( $parser, $string = '', $length = 0, $padding = '0' ) {
+ public static function padleft( $parser, $string = '', $length = 0, $padding = '0' ) {
return self::pad( $parser, $string, $length, $padding, STR_PAD_LEFT );
}
- static function padright( $parser, $string = '', $length = 0, $padding = '0' ) {
+ public static function padright( $parser, $string = '', $length = 0, $padding = '0' ) {
return self::pad( $parser, $string, $length, $padding );
}
@@ -842,12 +843,12 @@ class CoreParserFunctions {
* @param string $text
* @return string
*/
- static function anchorencode( $parser, $text ) {
+ public static function anchorencode( $parser, $text ) {
$text = $parser->killMarkers( $text );
return (string)substr( $parser->guessSectionNameFromWikiText( $text ), 1 );
}
- static function special( $parser, $text ) {
+ public static function special( $parser, $text ) {
list( $page, $subpage ) = SpecialPageFactory::resolveAlias( $text );
if ( $page ) {
$title = SpecialPage::getTitleFor( $page, $subpage );
@@ -859,7 +860,7 @@ class CoreParserFunctions {
}
}
- static function speciale( $parser, $text ) {
+ public static function speciale( $parser, $text ) {
return wfUrlencode( str_replace( ' ', '_', self::special( $parser, $text ) ) );
}
diff --git a/includes/parser/CoreTagHooks.php b/includes/parser/CoreTagHooks.php
index 01ad97c3bdc3..85920cc11f8f 100644
--- a/includes/parser/CoreTagHooks.php
+++ b/includes/parser/CoreTagHooks.php
@@ -30,7 +30,7 @@ class CoreTagHooks {
* @param Parser $parser
* @return void
*/
- static function register( $parser ) {
+ public static function register( $parser ) {
global $wgRawHtml;
$parser->setHook( 'pre', array( __CLASS__, 'pre' ) );
$parser->setHook( 'nowiki', array( __CLASS__, 'nowiki' ) );
@@ -50,7 +50,7 @@ class CoreTagHooks {
* @param Parser $parser
* @return string HTML
*/
- static function pre( $text, $attribs, $parser ) {
+ public static function pre( $text, $attribs, $parser ) {
// Backwards-compatibility hack
$content = StringUtils::delimiterReplace( '<nowiki>', '</nowiki>', '$1', $text, 'i' );
@@ -75,7 +75,7 @@ class CoreTagHooks {
* @throws MWException
* @return array
*/
- static function html( $content, $attributes, $parser ) {
+ public static function html( $content, $attributes, $parser ) {
global $wgRawHtml;
if ( $wgRawHtml ) {
return array( $content, 'markerType' => 'nowiki' );
@@ -96,7 +96,7 @@ class CoreTagHooks {
* @param Parser $parser
* @return array
*/
- static function nowiki( $content, $attributes, $parser ) {
+ public static function nowiki( $content, $attributes, $parser ) {
$content = strtr( $content, array( '-{' => '-&#123;', '}-' => '&#125;-' ) );
return array( Xml::escapeTagsOnly( $content ), 'markerType' => 'nowiki' );
}
@@ -116,7 +116,7 @@ class CoreTagHooks {
* @param Parser $parser
* @return string HTML
*/
- static function gallery( $content, $attributes, $parser ) {
+ public static function gallery( $content, $attributes, $parser ) {
return $parser->renderImageGallery( $content, $attributes );
}
}
diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php
index 0bf2ffcac8b9..82f0e9d48ff0 100644
--- a/includes/parser/DateFormatter.php
+++ b/includes/parser/DateFormatter.php
@@ -27,11 +27,11 @@
* @ingroup Parser
*/
class DateFormatter {
- var $mSource, $mTarget;
- var $monthNames = '', $rxDM, $rxMD, $rxDMY, $rxYDM, $rxMDY, $rxYMD;
+ public $mSource, $mTarget;
+ public $monthNames = '', $rxDM, $rxMD, $rxDMY, $rxYDM, $rxMDY, $rxYMD;
- var $regexes, $pDays, $pMonths, $pYears;
- var $rules, $xMonths, $preferences;
+ public $regexes, $pDays, $pMonths, $pYears;
+ public $rules, $xMonths, $preferences;
protected $lang;
@@ -51,7 +51,7 @@ class DateFormatter {
/**
* @param Language $lang In which language to format the date
*/
- function __construct( Language $lang ) {
+ public function __construct( Language $lang ) {
$this->lang = $lang;
$this->monthNames = $this->getMonthRegex();
@@ -146,7 +146,7 @@ class DateFormatter {
*
* @return string
*/
- function reformat( $preference, $text, $options = array( 'linked' ) ) {
+ public function reformat( $preference, $text, $options = array( 'linked' ) ) {
$linked = in_array( 'linked', $options );
$match_whole = in_array( 'match-whole', $options );
@@ -196,7 +196,7 @@ class DateFormatter {
* @param array $matches
* @return string
*/
- function replace( $matches ) {
+ public function replace( $matches ) {
# Extract information from $matches
$linked = true;
if ( isset( $this->mLinked ) ) {
@@ -220,7 +220,7 @@ class DateFormatter {
* @param bool $link
* @return string
*/
- function formatDate( $bits, $link = true ) {
+ public function formatDate( $bits, $link = true ) {
$format = $this->targets[$this->mTarget];
if ( !$link ) {
@@ -318,7 +318,7 @@ class DateFormatter {
* @todo document
* @return string
*/
- function getMonthRegex() {
+ public function getMonthRegex() {
$names = array();
for ( $i = 1; $i <= 12; $i++ ) {
$names[] = $this->lang->getMonthName( $i );
@@ -332,7 +332,7 @@ class DateFormatter {
* @param string $monthName Month name
* @return string ISO month name
*/
- function makeIsoMonth( $monthName ) {
+ public function makeIsoMonth( $monthName ) {
$n = $this->xMonths[$this->lang->lc( $monthName )];
return sprintf( '%02d', $n );
}
@@ -342,7 +342,7 @@ class DateFormatter {
* @param string $year Year name
* @return string ISO year name
*/
- function makeIsoYear( $year ) {
+ public function makeIsoYear( $year ) {
# Assumes the year is in a nice format, as enforced by the regex
if ( substr( $year, -2 ) == 'BC' ) {
$num = intval( substr( $year, 0, -3 ) ) - 1;
@@ -360,7 +360,7 @@ class DateFormatter {
* @param string $iso
* @return int|string
*/
- function makeNormalYear( $iso ) {
+ public function makeNormalYear( $iso ) {
if ( $iso[0] == '-' ) {
$text = ( intval( substr( $iso, 1 ) ) + 1 ) . ' BC';
} else {
diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php
index 30bb2cffb015..c3925b3e4dc2 100644
--- a/includes/parser/LinkHolderArray.php
+++ b/includes/parser/LinkHolderArray.php
@@ -25,26 +25,27 @@
* @ingroup Parser
*/
class LinkHolderArray {
- var $internals = array(), $interwikis = array();
- var $size = 0;
+ public $internals = array();
+ public $interwikis = array();
+ public $size = 0;
/**
* @var Parser
*/
- var $parent;
+ public $parent;
protected $tempIdOffset;
/**
* @param Parser $parent
*/
- function __construct( $parent ) {
+ public function __construct( $parent ) {
$this->parent = $parent;
}
/**
* Reduce memory usage to reduce the impact of circular references
*/
- function __destruct() {
+ public function __destruct() {
foreach ( $this as $name => $value ) {
unset( $this->$name );
}
@@ -58,7 +59,7 @@ class LinkHolderArray {
* Compact the titles, only serialize the text form.
* @return array
*/
- function __sleep() {
+ public function __sleep() {
foreach ( $this->internals as &$nsLinks ) {
foreach ( $nsLinks as &$entry ) {
unset( $entry['title'] );
@@ -78,7 +79,7 @@ class LinkHolderArray {
/**
* Recreate the Title objects
*/
- function __wakeup() {
+ public function __wakeup() {
foreach ( $this->internals as &$nsLinks ) {
foreach ( $nsLinks as &$entry ) {
$entry['title'] = Title::newFromText( $entry['pdbk'] );
@@ -97,7 +98,7 @@ class LinkHolderArray {
* Merge another LinkHolderArray into this one
* @param LinkHolderArray $other
*/
- function merge( $other ) {
+ public function merge( $other ) {
foreach ( $other->internals as $ns => $entries ) {
$this->size += count( $entries );
if ( !isset( $this->internals[$ns] ) ) {
@@ -121,7 +122,7 @@ class LinkHolderArray {
* @param array $texts Array of strings
* @return array
*/
- function mergeForeign( $other, $texts ) {
+ public function mergeForeign( $other, $texts ) {
$this->tempIdOffset = $idOffset = $this->parent->nextLinkID();
$maxId = 0;
@@ -165,7 +166,7 @@ class LinkHolderArray {
* @param string $text
* @return LinkHolderArray
*/
- function getSubArray( $text ) {
+ public function getSubArray( $text ) {
$sub = new LinkHolderArray( $this->parent );
# Internal links
@@ -199,7 +200,7 @@ class LinkHolderArray {
* Returns true if the memory requirements of this object are getting large
* @return bool
*/
- function isBig() {
+ public function isBig() {
global $wgLinkHolderBatchSize;
return $this->size > $wgLinkHolderBatchSize;
}
@@ -208,7 +209,7 @@ class LinkHolderArray {
* Clear all stored link holders.
* Make sure you don't have any text left using these link holders, before you call this
*/
- function clear() {
+ public function clear() {
$this->internals = array();
$this->interwikis = array();
$this->size = 0;
@@ -227,7 +228,7 @@ class LinkHolderArray {
* @param string $prefix [optional]
* @return string
*/
- function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
+ public function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
wfProfileIn( __METHOD__ );
if ( !is_object( $nt ) ) {
# Fail gracefully
@@ -268,7 +269,7 @@ class LinkHolderArray {
* @param string $text
* @return array Array of link CSS classes, indexed by PDBK.
*/
- function replace( &$text ) {
+ public function replace( &$text ) {
wfProfileIn( __METHOD__ );
/** @todo FIXME: replaceInternal doesn't return a value */
@@ -630,7 +631,7 @@ class LinkHolderArray {
* @param string $text
* @return string
*/
- function replaceText( $text ) {
+ public function replaceText( $text ) {
wfProfileIn( __METHOD__ );
$text = preg_replace_callback(
@@ -649,7 +650,7 @@ class LinkHolderArray {
* @return string
* @private
*/
- function replaceTextCallback( $matches ) {
+ public function replaceTextCallback( $matches ) {
$type = $matches[1];
$key = $matches[2];
if ( $type == 'LINK' ) {
diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php
index f7fe5a8d91c1..a108d2beea2c 100644
--- a/includes/parser/MWTidy.php
+++ b/includes/parser/MWTidy.php
@@ -83,7 +83,7 @@ class MWTidyWrapper {
*
* @return string
*/
- function replaceCallback( $m ) {
+ public function replaceCallback( $m ) {
$marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
$this->mMarkerIndex++;
$this->mTokens->setPair( $marker, $m[0] );
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 36f306d3bd5c..c5c472ada82c 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -120,61 +120,61 @@ class Parser {
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;
+ public $mTagHooks = array();
+ public $mTransparentTagHooks = array();
+ public $mFunctionHooks = array();
+ public $mFunctionSynonyms = array( 0 => array(), 1 => array() );
+ public $mFunctionTagHooks = array();
+ public $mStripList = array();
+ public $mDefaultStripList = array();
+ public $mVarCache = array();
+ public $mImageParams = array();
+ public $mImageParamsMagicArray = array();
+ public $mMarkerIndex = 0;
+ public $mFirstCall = true;
# Initialised by initialiseVariables()
/**
* @var MagicWordArray
*/
- var $mVariables;
+ public $mVariables;
/**
* @var MagicWordArray
*/
- var $mSubstWords;
- var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
+ public $mSubstWords;
+ public $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
# Cleared with clearState():
/**
* @var ParserOutput
*/
- var $mOutput;
- var $mAutonumber, $mDTopen;
+ public $mOutput;
+ public $mAutonumber, $mDTopen;
/**
* @var StripState
*/
- var $mStripState;
+ public $mStripState;
- var $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
+ public $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
/**
* @var LinkHolderArray
*/
- var $mLinkHolders;
+ public $mLinkHolders;
- var $mLinkID;
- var $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth;
- var $mDefaultSort;
- var $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
- var $mExpensiveFunctionCount; # number of expensive parser function calls
- var $mShowToc, $mForceTocPosition;
+ public $mLinkID;
+ public $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth;
+ public $mDefaultSort;
+ public $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
+ public $mExpensiveFunctionCount; # number of expensive parser function calls
+ public $mShowToc, $mForceTocPosition;
/**
* @var User
*/
- var $mUser; # User object; only used when doing pre-save transform
+ public $mUser; # User object; only used when doing pre-save transform
# Temporary
# These are variables reset at least once per parse regardless of $clearState
@@ -182,33 +182,33 @@ class Parser {
/**
* @var ParserOptions
*/
- var $mOptions;
+ 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.
+ public $mTitle; # Title context, used for self-link rendering and similar things
+ public $mOutputType; # Output type, one of the OT_xxx constants
+ public $ot; # Shortcut alias, see setOutputType()
+ public $mRevisionObject; # The revision object of the specified revision ID
+ public $mRevisionId; # ID to display in {{REVISIONID}} tags
+ public $mRevisionTimestamp; # The timestamp of the specified revision ID
+ public $mRevisionUser; # User to display in {{REVISIONUSER}} tag
+ public $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable
+ public $mRevIdForTs; # The revision ID which was used to fetch the timestamp
+ public $mInputSize = false; # For {{PAGESIZE}} on current page.
/**
* @var string
*/
- var $mUniqPrefix;
+ public $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.
*/
- var $mLangLinkLanguages;
+ public $mLangLinkLanguages;
/**
* @var bool Recursive call protection.
@@ -244,7 +244,7 @@ class Parser {
/**
* Reduce memory usage to reduce the impact of circular references
*/
- function __destruct() {
+ public function __destruct() {
if ( isset( $this->mLinkHolders ) ) {
unset( $this->mLinkHolders );
}
@@ -256,7 +256,7 @@ class Parser {
/**
* Allow extensions to clean up when the parser is cloned
*/
- function __clone() {
+ public function __clone() {
$this->mInParse = false;
wfRunHooks( 'ParserCloned', array( $this ) );
}
@@ -264,7 +264,7 @@ class Parser {
/**
* Do various kinds of initialisation on the first call of the parser
*/
- function firstCallInit() {
+ public function firstCallInit() {
if ( !$this->mFirstCall ) {
return;
}
@@ -285,7 +285,7 @@ class Parser {
*
* @private
*/
- function clearState() {
+ public function clearState() {
wfProfileIn( __METHOD__ );
if ( $this->mFirstCall ) {
$this->firstCallInit();
@@ -605,7 +605,7 @@ class Parser {
*
* @return string
*/
- function recursiveTagParse( $text, $frame = false ) {
+ public function recursiveTagParse( $text, $frame = false ) {
wfProfileIn( __METHOD__ );
wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$this->mStripState ) );
@@ -625,7 +625,7 @@ class Parser {
* @param bool|PPFrame $frame
* @return mixed|string
*/
- function preprocess( $text, Title $title = null, ParserOptions $options, $revid = null, $frame = false ) {
+ public function preprocess( $text, Title $title = null, ParserOptions $options, $revid = null, $frame = false ) {
wfProfileIn( __METHOD__ );
$magicScopeVariable = $this->lock();
$this->startParse( $title, $options, self::OT_PREPROCESS, true );
@@ -700,7 +700,7 @@ class Parser {
*
* @param User|null $user User object or null (to reset)
*/
- function setUser( $user ) {
+ public function setUser( $user ) {
$this->mUser = $user;
}
@@ -727,7 +727,7 @@ class Parser {
*
* @param Title $t
*/
- function setTitle( $t ) {
+ public function setTitle( $t ) {
if ( !$t ) {
$t = Title::newFromText( 'NO TITLE' );
}
@@ -746,7 +746,7 @@ class Parser {
*
* @return Title
*/
- function getTitle() {
+ public function getTitle() {
return $this->mTitle;
}
@@ -756,7 +756,7 @@ class Parser {
* @param Title $x Title object or null to just get the current one
* @return Title
*/
- function Title( $x = null ) {
+ public function Title( $x = null ) {
return wfSetVar( $this->mTitle, $x );
}
@@ -765,7 +765,7 @@ class Parser {
*
* @param int $ot New value
*/
- function setOutputType( $ot ) {
+ public function setOutputType( $ot ) {
$this->mOutputType = $ot;
# Shortcut alias
$this->ot = array(
@@ -782,7 +782,7 @@ class Parser {
* @param int|null $x New value or null to just get the current one
* @return int
*/
- function OutputType( $x = null ) {
+ public function OutputType( $x = null ) {
return wfSetVar( $this->mOutputType, $x );
}
@@ -791,7 +791,7 @@ class Parser {
*
* @return ParserOutput
*/
- function getOutput() {
+ public function getOutput() {
return $this->mOutput;
}
@@ -800,7 +800,7 @@ class Parser {
*
* @return ParserOptions
*/
- function getOptions() {
+ public function getOptions() {
return $this->mOptions;
}
@@ -810,21 +810,21 @@ class Parser {
* @param ParserOptions $x New value or null to just get the current one
* @return ParserOptions Current ParserOptions object
*/
- function Options( $x = null ) {
+ public function Options( $x = null ) {
return wfSetVar( $this->mOptions, $x );
}
/**
* @return int
*/
- function nextLinkID() {
+ public function nextLinkID() {
return $this->mLinkID++;
}
/**
* @param int $id
*/
- function setLinkID( $id ) {
+ public function setLinkID( $id ) {
$this->mLinkID = $id;
}
@@ -832,7 +832,7 @@ class Parser {
* Get a language object for use in parser functions such as {{FORMATNUM:}}
* @return Language
*/
- function getFunctionLang() {
+ public function getFunctionLang() {
return $this->getTargetLanguage();
}
@@ -863,7 +863,7 @@ class Parser {
* Get the language object for language conversion
* @return Language|null
*/
- function getConverterLanguage() {
+ public function getConverterLanguage() {
return $this->getTargetLanguage();
}
@@ -873,7 +873,7 @@ class Parser {
*
* @return User
*/
- function getUser() {
+ public function getUser() {
if ( !is_null( $this->mUser ) ) {
return $this->mUser;
}
@@ -885,7 +885,7 @@ class Parser {
*
* @return Preprocessor
*/
- function getPreprocessor() {
+ public function getPreprocessor() {
if ( !isset( $this->mPreprocessor ) ) {
$class = $this->mPreprocessorClass;
$this->mPreprocessor = new $class( $this );
@@ -980,7 +980,7 @@ class Parser {
*
* @return array
*/
- function getStripList() {
+ public function getStripList() {
return $this->mStripList;
}
@@ -993,7 +993,7 @@ class Parser {
*
* @return string
*/
- function insertStripItem( $text ) {
+ public function insertStripItem( $text ) {
$rnd = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}-" . self::MARKER_SUFFIX;
$this->mMarkerIndex++;
$this->mStripState->addGeneral( $rnd, $text );
@@ -1007,7 +1007,7 @@ class Parser {
* @param string $text
* @return string
*/
- function doTableStuff( $text ) {
+ public function doTableStuff( $text ) {
wfProfileIn( __METHOD__ );
$lines = StringUtils::explode( "\n", $text );
@@ -1212,7 +1212,7 @@ class Parser {
*
* @return string
*/
- function internalParse( $text, $isMain = true, $frame = false ) {
+ public function internalParse( $text, $isMain = true, $frame = false ) {
wfProfileIn( __METHOD__ );
$origText = $text;
@@ -1285,7 +1285,7 @@ class Parser {
*
* @return string
*/
- function doMagicLinks( $text ) {
+ public function doMagicLinks( $text ) {
wfProfileIn( __METHOD__ );
$prots = wfUrlProtocolsWithoutProtRel();
$urlChar = self::EXT_LINK_URL_CLASS;
@@ -1310,7 +1310,7 @@ class Parser {
* @param array $m
* @return HTML|string
*/
- function magicLinkCallback( $m ) {
+ public function magicLinkCallback( $m ) {
if ( isset( $m[1] ) && $m[1] !== '' ) {
# Skip anchor
return $m[0];
@@ -1363,7 +1363,7 @@ class Parser {
* @return string HTML
* @private
*/
- function makeFreeExternalLink( $url ) {
+ public function makeFreeExternalLink( $url ) {
wfProfileIn( __METHOD__ );
$trail = '';
@@ -1418,7 +1418,7 @@ class Parser {
*
* @return string
*/
- function doHeadings( $text ) {
+ public function doHeadings( $text ) {
wfProfileIn( __METHOD__ );
for ( $i = 6; $i >= 1; --$i ) {
$h = str_repeat( '=', $i );
@@ -1436,7 +1436,7 @@ class Parser {
*
* @return string The altered text
*/
- function doAllQuotes( $text ) {
+ public function doAllQuotes( $text ) {
wfProfileIn( __METHOD__ );
$outtext = '';
$lines = StringUtils::explode( "\n", $text );
@@ -1645,7 +1645,7 @@ class Parser {
* @throws MWException
* @return string
*/
- function replaceExternalLinks( $text ) {
+ public function replaceExternalLinks( $text ) {
wfProfileIn( __METHOD__ );
$bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
@@ -1748,7 +1748,7 @@ class Parser {
* nofollow if appropriate
* @return array Associative array of HTML attributes
*/
- function getExternalLinkAttribs( $url = false ) {
+ public function getExternalLinkAttribs( $url = false ) {
$attribs = array();
$attribs['rel'] = self::getExternalLinkRel( $url, $this->mTitle );
@@ -1769,7 +1769,7 @@ class Parser {
* the URL differently; as a workaround, just use the output for
* statistical records, not for actual linking/output.
*/
- static function replaceUnusualEscapes( $url ) {
+ public static function replaceUnusualEscapes( $url ) {
return preg_replace_callback( '/%[0-9A-Fa-f]{2}/',
array( __CLASS__, 'replaceUnusualEscapesCallback' ), $url );
}
@@ -1862,7 +1862,7 @@ class Parser {
*
* @private
*/
- function replaceInternalLinks( $s ) {
+ public function replaceInternalLinks( $s ) {
$this->mLinkHolders->merge( $this->replaceInternalLinks2( $s ) );
return $s;
}
@@ -1875,7 +1875,7 @@ class Parser {
*
* @private
*/
- function replaceInternalLinks2( &$s ) {
+ public function replaceInternalLinks2( &$s ) {
global $wgExtraInterlanguageLinkPrefixes;
wfProfileIn( __METHOD__ );
@@ -2227,7 +2227,7 @@ class Parser {
* @param string $prefix
* @return string HTML-wikitext mix oh yuck
*/
- function makeKnownLinkHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
+ public function makeKnownLinkHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
list( $inside, $trail ) = Linker::splitTrail( $trail );
if ( is_string( $query ) ) {
@@ -2252,7 +2252,7 @@ class Parser {
* @param string $text More-or-less HTML
* @return string Less-or-more HTML with NOPARSE bits
*/
- function armorLinks( $text ) {
+ public function armorLinks( $text ) {
return preg_replace( '/\b((?i)' . $this->mUrlProtocols . ')/',
"{$this->mUniqPrefix}NOPARSE$1", $text );
}
@@ -2261,7 +2261,7 @@ class Parser {
* Return true if subpage links should be expanded on this page.
* @return bool
*/
- function areSubpagesAllowed() {
+ public function areSubpagesAllowed() {
# Some namespaces don't allow subpages
return MWNamespace::hasSubpages( $this->mTitle->getNamespace() );
}
@@ -2274,7 +2274,7 @@ class Parser {
* @return string The full name of the link
* @private
*/
- function maybeDoSubpageLink( $target, &$text ) {
+ public function maybeDoSubpageLink( $target, &$text ) {
return Linker::normalizeSubpageLink( $this->mTitle, $target, $text );
}
@@ -2284,7 +2284,7 @@ class Parser {
*
* @return string
*/
- function closeParagraph() {
+ public function closeParagraph() {
$result = '';
if ( $this->mLastSection != '' ) {
$result = '</' . $this->mLastSection . ">\n";
@@ -2304,7 +2304,7 @@ class Parser {
*
* @return int
*/
- function getCommon( $st1, $st2 ) {
+ public function getCommon( $st1, $st2 ) {
$fl = strlen( $st1 );
$shorter = strlen( $st2 );
if ( $fl < $shorter ) {
@@ -2328,7 +2328,7 @@ class Parser {
*
* @return string
*/
- function openList( $char ) {
+ public function openList( $char ) {
$result = $this->closeParagraph();
if ( '*' === $char ) {
@@ -2354,7 +2354,7 @@ class Parser {
*
* @return string
*/
- function nextItem( $char ) {
+ public function nextItem( $char ) {
if ( '*' === $char || '#' === $char ) {
return "</li>\n<li>";
} elseif ( ':' === $char || ';' === $char ) {
@@ -2380,7 +2380,7 @@ class Parser {
*
* @return string
*/
- function closeList( $char ) {
+ public function closeList( $char ) {
if ( '*' === $char ) {
$text = "</li></ul>";
} elseif ( '#' === $char ) {
@@ -2407,7 +2407,7 @@ class Parser {
* @private
* @return string The lists rendered as HTML
*/
- function doBlockLevels( $text, $linestart ) {
+ public function doBlockLevels( $text, $linestart ) {
wfProfileIn( __METHOD__ );
# Parsing through the text line by line. The main thing
@@ -2625,7 +2625,7 @@ class Parser {
* @throws MWException
* @return string The position of the ':', or false if none found
*/
- function findColonNoLinks( $str, &$before, &$after ) {
+ public function findColonNoLinks( $str, &$before, &$after ) {
wfProfileIn( __METHOD__ );
$pos = strpos( $str, ':' );
@@ -2793,7 +2793,7 @@ class Parser {
* @throws MWException
* @return string
*/
- function getVariableValue( $index, $frame = false ) {
+ public function getVariableValue( $index, $frame = false ) {
global $wgContLang, $wgSitename, $wgServer, $wgServerName;
global $wgArticlePath, $wgScriptPath, $wgStylePath;
@@ -3149,7 +3149,7 @@ class Parser {
*
* @private
*/
- function initialiseVariables() {
+ public function initialiseVariables() {
wfProfileIn( __METHOD__ );
$variableIDs = MagicWord::getVariableIDs();
$substIDs = MagicWord::getSubstIDs();
@@ -3181,7 +3181,7 @@ class Parser {
*
* @return PPNode
*/
- function preprocessToDom( $text, $flags = 0 ) {
+ public function preprocessToDom( $text, $flags = 0 ) {
$dom = $this->getPreprocessor()->preprocessToObj( $text, $flags );
return $dom;
}
@@ -3256,7 +3256,7 @@ class Parser {
*
* @return array
*/
- static function createAssocArgs( $args ) {
+ public static function createAssocArgs( $args ) {
$assocArgs = array();
$index = 1;
foreach ( $args as $arg ) {
@@ -3302,7 +3302,7 @@ class Parser {
* @param string|int|null $max Maximum allowed, when an explicit limit has been
* exceeded, provide the values (optional)
*/
- function limitationWarn( $limitationType, $current = '', $max = '' ) {
+ public function limitationWarn( $limitationType, $current = '', $max = '' ) {
# does no harm if $current and $max are present but are unnecessary for the message
$warning = wfMessage( "$limitationType-warning" )->numParams( $current, $max )
->inLanguage( $this->mOptions->getUserLangObj() )->text();
@@ -3762,7 +3762,7 @@ class Parser {
*
* @return array
*/
- function getTemplateDom( $title ) {
+ public function getTemplateDom( $title ) {
$cacheTitle = $title;
$titleText = $title->getPrefixedDBkey();
@@ -3799,7 +3799,7 @@ class Parser {
* @param Title $title
* @return array ( string or false, Title )
*/
- function fetchTemplateAndTitle( $title ) {
+ public function fetchTemplateAndTitle( $title ) {
// Defaults to Parser::statelessFetchTemplate()
$templateCb = $this->mOptions->getTemplateCallback();
$stuff = call_user_func( $templateCb, $title, $this );
@@ -3823,7 +3823,7 @@ class Parser {
* @param Title $title
* @return string|bool
*/
- function fetchTemplate( $title ) {
+ public function fetchTemplate( $title ) {
$rv = $this->fetchTemplateAndTitle( $title );
return $rv[0];
}
@@ -3837,7 +3837,7 @@ class Parser {
*
* @return array
*/
- static function statelessFetchTemplate( $title, $parser = false ) {
+ public static function statelessFetchTemplate( $title, $parser = false ) {
$text = $skip = false;
$finalTitle = $title;
$deps = array();
@@ -3921,7 +3921,7 @@ class Parser {
* @param array $options Array of options to RepoGroup::findFile
* @return File|bool
*/
- function fetchFile( $title, $options = array() ) {
+ public function fetchFile( $title, $options = array() ) {
$res = $this->fetchFileAndTitle( $title, $options );
return $res[0];
}
@@ -3933,7 +3933,7 @@ class Parser {
* @param array $options Array of options to RepoGroup::findFile
* @return array ( File or false, Title of file )
*/
- function fetchFileAndTitle( $title, $options = array() ) {
+ public function fetchFileAndTitle( $title, $options = array() ) {
$file = $this->fetchFileNoRegister( $title, $options );
$time = $file ? $file->getTimestamp() : false;
@@ -3977,7 +3977,7 @@ class Parser {
*
* @return string
*/
- function interwikiTransclude( $title, $action ) {
+ public function interwikiTransclude( $title, $action ) {
global $wgEnableScaryTranscluding;
if ( !$wgEnableScaryTranscluding ) {
@@ -3996,7 +3996,7 @@ class Parser {
* @param string $url
* @return mixed|string
*/
- function fetchScaryTemplateMaybeFromCache( $url ) {
+ public function fetchScaryTemplateMaybeFromCache( $url ) {
global $wgTranscludeCacheExpiry;
$dbr = wfGetDB( DB_SLAVE );
$tsCond = $dbr->timestamp( time() - $wgTranscludeCacheExpiry );
@@ -4036,7 +4036,7 @@ class Parser {
*
* @return array
*/
- function argSubstitution( $piece, $frame ) {
+ public function argSubstitution( $piece, $frame ) {
wfProfileIn( __METHOD__ );
$error = false;
@@ -4091,7 +4091,7 @@ class Parser {
* @throws MWException
* @return string
*/
- function extensionSubstitution( $params, $frame ) {
+ public function extensionSubstitution( $params, $frame ) {
$name = $frame->expand( $params['name'] );
$attrText = !isset( $params['attr'] ) ? null : $frame->expand( $params['attr'] );
$content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] );
@@ -4175,7 +4175,7 @@ class Parser {
* @param int $size The size of the text
* @return bool False if this inclusion would take it over the maximum, true otherwise
*/
- function incrementIncludeSize( $type, $size ) {
+ public function incrementIncludeSize( $type, $size ) {
if ( $this->mIncludeSizes[$type] + $size > $this->mOptions->getMaxIncludeSize() ) {
return false;
} else {
@@ -4189,7 +4189,7 @@ class Parser {
*
* @return bool False if the limit has been exceeded
*/
- function incrementExpensiveFunctionCount() {
+ public function incrementExpensiveFunctionCount() {
$this->mExpensiveFunctionCount++;
return $this->mExpensiveFunctionCount <= $this->mOptions->getExpensiveParserFunctionLimit();
}
@@ -4202,7 +4202,7 @@ class Parser {
*
* @return string
*/
- function doDoubleUnderscore( $text ) {
+ public function doDoubleUnderscore( $text ) {
wfProfileIn( __METHOD__ );
# The position of __TOC__ needs to be recorded
@@ -4308,7 +4308,7 @@ class Parser {
* @return mixed|string
* @private
*/
- function formatHeadings( $text, $origText, $isMain = true ) {
+ public function formatHeadings( $text, $origText, $isMain = true ) {
global $wgMaxTocLevel, $wgExperimentalHtmlIds;
# Inhibit editsection links if requested in the page
@@ -4828,7 +4828,7 @@ class Parser {
* or null to use default value
* @return string
*/
- function getUserSig( &$user, $nickname = false, $fancySig = null ) {
+ public function getUserSig( &$user, $nickname = false, $fancySig = null ) {
global $wgMaxSigChars;
$username = $user->getName();
@@ -4877,7 +4877,7 @@ class Parser {
* @param string $text
* @return string|bool An expanded string, or false if invalid.
*/
- function validateSig( $text ) {
+ public function validateSig( $text ) {
return Xml::isWellFormedXmlFragment( $text ) ? $text : false;
}
@@ -5050,7 +5050,7 @@ class Parser {
* @throws MWException
* @return callable|null The old value of the mTagHooks array associated with the hook
*/
- function setTransparentTagHook( $tag, $callback ) {
+ public function setTransparentTagHook( $tag, $callback ) {
$tag = strtolower( $tag );
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setTransparentHook('$tag', ...) call" );
@@ -5064,7 +5064,7 @@ class Parser {
/**
* Remove all tag hooks
*/
- function clearTagHooks() {
+ public function clearTagHooks() {
$this->mTagHooks = array();
$this->mFunctionTagHooks = array();
$this->mStripList = $this->mDefaultStripList;
@@ -5151,7 +5151,7 @@ class Parser {
*
* @return array
*/
- function getFunctionHooks() {
+ public function getFunctionHooks() {
return array_keys( $this->mFunctionHooks );
}
@@ -5165,7 +5165,7 @@ class Parser {
* @throws MWException
* @return null
*/
- function setFunctionTagHook( $tag, $callback, $flags ) {
+ public function setFunctionTagHook( $tag, $callback, $flags ) {
$tag = strtolower( $tag );
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setFunctionTagHook('$tag', ...) call" );
@@ -5191,7 +5191,7 @@ class Parser {
*
* @return array Array of link CSS classes, indexed by PDBK.
*/
- function replaceLinkHolders( &$text, $options = 0 ) {
+ public function replaceLinkHolders( &$text, $options = 0 ) {
return $this->mLinkHolders->replace( $text );
}
@@ -5202,7 +5202,7 @@ class Parser {
* @param string $text
* @return string
*/
- function replaceLinkHoldersText( $text ) {
+ public function replaceLinkHoldersText( $text ) {
return $this->mLinkHolders->replaceText( $text );
}
@@ -5219,7 +5219,7 @@ class Parser {
* @param array $params
* @return string HTML
*/
- function renderImageGallery( $text, $params ) {
+ public function renderImageGallery( $text, $params ) {
wfProfileIn( __METHOD__ );
$mode = false;
@@ -5380,7 +5380,7 @@ class Parser {
* @param string $handler
* @return array
*/
- function getImageParams( $handler ) {
+ public function getImageParams( $handler ) {
if ( $handler ) {
$handlerClass = get_class( $handler );
} else {
@@ -5428,7 +5428,7 @@ class Parser {
* @param LinkHolderArray|bool $holders
* @return string HTML
*/
- function makeImage( $title, $options, $holders = false ) {
+ public function makeImage( $title, $options, $holders = false ) {
# Check if the options text is of the form "options|alt text"
# Options are:
# * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang
@@ -5667,7 +5667,7 @@ class Parser {
* Set a flag in the output object indicating that the content is dynamic and
* shouldn't be cached.
*/
- function disableCache() {
+ public function disableCache() {
wfDebug( "Parser output marked as uncacheable.\n" );
if ( !$this->mOutput ) {
throw new MWException( __METHOD__ .
@@ -5685,7 +5685,7 @@ class Parser {
* @param bool|PPFrame $frame
* @return string
*/
- function attributeStripCallback( &$text, $frame = false ) {
+ public function attributeStripCallback( &$text, $frame = false ) {
$text = $this->replaceVariables( $text, $frame );
$text = $this->mStripState->unstripBoth( $text );
return $text;
@@ -5696,7 +5696,7 @@ class Parser {
*
* @return array
*/
- function getTags() {
+ public function getTags() {
return array_merge(
array_keys( $this->mTransparentTagHooks ),
array_keys( $this->mTagHooks ),
@@ -5714,7 +5714,7 @@ class Parser {
*
* @return string
*/
- function replaceTransparentTags( $text ) {
+ public function replaceTransparentTags( $text ) {
$matches = array();
$elements = array_keys( $this->mTransparentTagHooks );
$text = self::extractTagsAndParams( $elements, $text, $matches, $this->mUniqPrefix );
@@ -5915,7 +5915,7 @@ class Parser {
*
* @return int|null
*/
- function getRevisionId() {
+ public function getRevisionId() {
return $this->mRevisionId;
}
@@ -5942,7 +5942,7 @@ class Parser {
* the default server-local timestamp
* @return string
*/
- function getRevisionTimestamp() {
+ public function getRevisionTimestamp() {
if ( is_null( $this->mRevisionTimestamp ) ) {
wfProfileIn( __METHOD__ );
@@ -5969,7 +5969,7 @@ class Parser {
*
* @return string User name
*/
- function getRevisionUser() {
+ public function getRevisionUser() {
if ( is_null( $this->mRevisionUser ) ) {
$revObject = $this->getRevisionObject();
@@ -5989,7 +5989,7 @@ class Parser {
*
* @return int|null Revision size
*/
- function getRevisionSize() {
+ public function getRevisionSize() {
if ( is_null( $this->mRevisionSize ) ) {
$revObject = $this->getRevisionObject();
@@ -6117,7 +6117,7 @@ class Parser {
*
* @return string
*/
- function testSrvus( $text, Title $title, ParserOptions $options, $outputType = self::OT_HTML ) {
+ public function testSrvus( $text, Title $title, ParserOptions $options, $outputType = self::OT_HTML ) {
$magicScopeVariable = $this->lock();
$this->startParse( $title, $options, $outputType, true );
@@ -6133,7 +6133,7 @@ class Parser {
* @param ParserOptions $options
* @return string
*/
- function testPst( $text, Title $title, ParserOptions $options ) {
+ public function testPst( $text, Title $title, ParserOptions $options ) {
return $this->preSaveTransform( $text, $title, $options->getUser(), $options );
}
@@ -6143,7 +6143,7 @@ class Parser {
* @param ParserOptions $options
* @return string
*/
- function testPreprocess( $text, Title $title, ParserOptions $options ) {
+ public function testPreprocess( $text, Title $title, ParserOptions $options ) {
return $this->testSrvus( $text, $title, $options, self::OT_PREPROCESS );
}
@@ -6163,7 +6163,7 @@ class Parser {
*
* @return string
*/
- function markerSkipCallback( $s, $callback ) {
+ public function markerSkipCallback( $s, $callback ) {
$i = 0;
$out = '';
while ( $i < strlen( $s ) ) {
@@ -6193,7 +6193,7 @@ class Parser {
* @param string $text Input string
* @return string
*/
- function killMarkers( $text ) {
+ public function killMarkers( $text ) {
return $this->mStripState->killMarkers( $text );
}
@@ -6213,7 +6213,7 @@ class Parser {
*
* @return array
*/
- function serializeHalfParsedText( $text ) {
+ public function serializeHalfParsedText( $text ) {
wfProfileIn( __METHOD__ );
$data = array(
'text' => $text,
@@ -6240,7 +6240,7 @@ class Parser {
* @throws MWException
* @return string
*/
- function unserializeHalfParsedText( $data ) {
+ public function unserializeHalfParsedText( $data ) {
if ( !isset( $data['version'] ) || $data['version'] != self::HALF_PARSED_VERSION ) {
throw new MWException( __METHOD__ . ': invalid version' );
}
@@ -6265,7 +6265,7 @@ class Parser {
*
* @return bool
*/
- function isValidHalfParsedText( $data ) {
+ public function isValidHalfParsedText( $data ) {
return isset( $data['version'] ) && $data['version'] == self::HALF_PARSED_VERSION;
}
diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php
index 6102ca481ebc..795230035c06 100644
--- a/includes/parser/ParserCache.php
+++ b/includes/parser/ParserCache.php
@@ -95,7 +95,7 @@ class ParserCache {
* @param ParserOptions $popts
* @return string
*/
- function getETag( $article, $popts ) {
+ public function getETag( $article, $popts ) {
return 'W/"' . $this->getParserOutputKey( $article,
$popts->optionsHash( ParserOptions::legacyOptions(), $article->getTitle() ) ) .
"--" . $article->getTouched() . '"';
diff --git a/includes/parser/ParserDiffTest.php b/includes/parser/ParserDiffTest.php
index 2db0597e2bdd..174c1d61ac30 100644
--- a/includes/parser/ParserDiffTest.php
+++ b/includes/parser/ParserDiffTest.php
@@ -26,19 +26,19 @@
*/
class ParserDiffTest
{
- var $parsers, $conf;
- var $shortOutput = false;
+ public $parsers;
+ public $conf;
+ public $shortOutput = false;
+ public $dtUniqPrefix;
- var $dtUniqPrefix;
-
- function __construct( $conf ) {
+ public function __construct( $conf ) {
if ( !isset( $conf['parsers'] ) ) {
throw new MWException( __METHOD__ . ': no parsers specified' );
}
$this->conf = $conf;
}
- function init() {
+ public function init() {
if ( !is_null( $this->parsers ) ) {
return;
}
@@ -64,7 +64,7 @@ class ParserDiffTest
}
}
- function __call( $name, $args ) {
+ public function __call( $name, $args ) {
$this->init();
$results = array();
$mismatch = false;
@@ -109,7 +109,7 @@ class ParserDiffTest
return $lastResult;
}
- function formatArray( $array ) {
+ public function formatArray( $array ) {
if ( $this->shortOutput ) {
foreach ( $array as $key => $value ) {
if ( $value instanceof ParserOutput ) {
@@ -120,7 +120,7 @@ class ParserDiffTest
return var_export( $array, true );
}
- function setFunctionHook( $id, $callback, $flags = 0 ) {
+ public function setFunctionHook( $id, $callback, $flags = 0 ) {
$this->init();
foreach ( $this->parsers as $parser ) {
$parser->setFunctionHook( $id, $callback, $flags );
@@ -131,7 +131,7 @@ class ParserDiffTest
* @param Parser $parser
* @return bool
*/
- function onClearState( &$parser ) {
+ public function onClearState( &$parser ) {
// hack marker prefixes to get identical output
if ( !isset( $this->dtUniqPrefix ) ) {
$this->dtUniqPrefix = $parser->uniqPrefix();
diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php
index 411702fe2211..64febcc52894 100644
--- a/includes/parser/ParserOptions.php
+++ b/includes/parser/ParserOptions.php
@@ -34,108 +34,108 @@ class ParserOptions {
/**
* Interlanguage links are removed and returned in an array
*/
- var $mInterwikiMagic;
+ public $mInterwikiMagic;
/**
* Allow external images inline?
*/
- var $mAllowExternalImages;
+ public $mAllowExternalImages;
/**
* If not, any exception?
*/
- var $mAllowExternalImagesFrom;
+ public $mAllowExternalImagesFrom;
/**
* If not or it doesn't match, should we check an on-wiki whitelist?
*/
- var $mEnableImageWhitelist;
+ public $mEnableImageWhitelist;
/**
* Date format index
*/
- var $mDateFormat = null;
+ public $mDateFormat = null;
/**
* Create "edit section" links?
*/
- var $mEditSection = true;
+ public $mEditSection = true;
/**
* Allow inclusion of special pages?
*/
- var $mAllowSpecialInclusion;
+ public $mAllowSpecialInclusion;
/**
* Use tidy to cleanup output HTML?
*/
- var $mTidy = false;
+ public $mTidy = false;
/**
* Which lang to call for PLURAL and GRAMMAR
*/
- var $mInterfaceMessage = false;
+ public $mInterfaceMessage = false;
/**
* Overrides $mInterfaceMessage with arbitrary language
*/
- var $mTargetLanguage = null;
+ public $mTargetLanguage = null;
/**
* Maximum size of template expansions, in bytes
*/
- var $mMaxIncludeSize;
+ public $mMaxIncludeSize;
/**
* Maximum number of nodes touched by PPFrame::expand()
*/
- var $mMaxPPNodeCount;
+ public $mMaxPPNodeCount;
/**
* Maximum number of nodes generated by Preprocessor::preprocessToObj()
*/
- var $mMaxGeneratedPPNodeCount;
+ public $mMaxGeneratedPPNodeCount;
/**
* Maximum recursion depth in PPFrame::expand()
*/
- var $mMaxPPExpandDepth;
+ public $mMaxPPExpandDepth;
/**
* Maximum recursion depth for templates within templates
*/
- var $mMaxTemplateDepth;
+ public $mMaxTemplateDepth;
/**
* Maximum number of calls per parse to expensive parser functions
*/
- var $mExpensiveParserFunctionLimit;
+ public $mExpensiveParserFunctionLimit;
/**
* Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS
*/
- var $mRemoveComments = true;
+ public $mRemoveComments = true;
/**
* Callback for template fetching. Used as first argument to call_user_func().
*/
- var $mTemplateCallback =
+ public $mTemplateCallback =
array( 'Parser', 'statelessFetchTemplate' );
/**
* Enable limit report in an HTML comment on output
*/
- var $mEnableLimitReport = false;
+ public $mEnableLimitReport = false;
/**
* Timestamp used for {{CURRENTDAY}} etc.
*/
- var $mTimestamp;
+ public $mTimestamp;
/**
* Target attribute for external links
*/
- var $mExternalLinkTarget;
+ public $mExternalLinkTarget;
/**
* Clean up signature texts?
@@ -143,32 +143,32 @@ class ParserOptions {
* 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures
* 2) Substitute all transclusions
*/
- var $mCleanSignatures;
+ public $mCleanSignatures;
/**
* Transform wiki markup when saving the page?
*/
- var $mPreSaveTransform = true;
+ public $mPreSaveTransform = true;
/**
* Whether content conversion should be disabled
*/
- var $mDisableContentConversion;
+ public $mDisableContentConversion;
/**
* Whether title conversion should be disabled
*/
- var $mDisableTitleConversion;
+ public $mDisableTitleConversion;
/**
* Automatically number headings?
*/
- var $mNumberHeadings;
+ public $mNumberHeadings;
/**
* Thumb size preferred by the user.
*/
- var $mThumbSize;
+ public $mThumbSize;
/**
* Maximum article size of an article to be marked as "stub"
@@ -178,169 +178,169 @@ class ParserOptions {
/**
* Language object of the User language.
*/
- var $mUserLang;
+ public $mUserLang;
/**
* @var User
* Stored user object
*/
- var $mUser;
+ public $mUser;
/**
* Parsing the page for a "preview" operation?
*/
- var $mIsPreview = false;
+ public $mIsPreview = false;
/**
* Parsing the page for a "preview" operation on a single section?
*/
- var $mIsSectionPreview = false;
+ public $mIsSectionPreview = false;
/**
* Parsing the printable version of the page?
*/
- var $mIsPrintable = false;
+ public $mIsPrintable = false;
/**
* Extra key that should be present in the caching key.
*/
- var $mExtraKey = '';
+ public $mExtraKey = '';
/**
* Function to be called when an option is accessed.
*/
protected $onAccessCallback = null;
- function getInterwikiMagic() {
+ public function getInterwikiMagic() {
return $this->mInterwikiMagic;
}
- function getAllowExternalImages() {
+ public function getAllowExternalImages() {
return $this->mAllowExternalImages;
}
- function getAllowExternalImagesFrom() {
+ public function getAllowExternalImagesFrom() {
return $this->mAllowExternalImagesFrom;
}
- function getEnableImageWhitelist() {
+ public function getEnableImageWhitelist() {
return $this->mEnableImageWhitelist;
}
- function getEditSection() {
+ public function getEditSection() {
return $this->mEditSection;
}
- function getNumberHeadings() {
+ public function getNumberHeadings() {
$this->optionUsed( 'numberheadings' );
return $this->mNumberHeadings;
}
- function getAllowSpecialInclusion() {
+ public function getAllowSpecialInclusion() {
return $this->mAllowSpecialInclusion;
}
- function getTidy() {
+ public function getTidy() {
return $this->mTidy;
}
- function getInterfaceMessage() {
+ public function getInterfaceMessage() {
return $this->mInterfaceMessage;
}
- function getTargetLanguage() {
+ public function getTargetLanguage() {
return $this->mTargetLanguage;
}
- function getMaxIncludeSize() {
+ public function getMaxIncludeSize() {
return $this->mMaxIncludeSize;
}
- function getMaxPPNodeCount() {
+ public function getMaxPPNodeCount() {
return $this->mMaxPPNodeCount;
}
- function getMaxGeneratedPPNodeCount() {
+ public function getMaxGeneratedPPNodeCount() {
return $this->mMaxGeneratedPPNodeCount;
}
- function getMaxPPExpandDepth() {
+ public function getMaxPPExpandDepth() {
return $this->mMaxPPExpandDepth;
}
- function getMaxTemplateDepth() {
+ public function getMaxTemplateDepth() {
return $this->mMaxTemplateDepth;
}
/* @since 1.20 */
- function getExpensiveParserFunctionLimit() {
+ public function getExpensiveParserFunctionLimit() {
return $this->mExpensiveParserFunctionLimit;
}
- function getRemoveComments() {
+ public function getRemoveComments() {
return $this->mRemoveComments;
}
- function getTemplateCallback() {
+ public function getTemplateCallback() {
return $this->mTemplateCallback;
}
- function getEnableLimitReport() {
+ public function getEnableLimitReport() {
return $this->mEnableLimitReport;
}
- function getCleanSignatures() {
+ public function getCleanSignatures() {
return $this->mCleanSignatures;
}
- function getExternalLinkTarget() {
+ public function getExternalLinkTarget() {
return $this->mExternalLinkTarget;
}
- function getDisableContentConversion() {
+ public function getDisableContentConversion() {
return $this->mDisableContentConversion;
}
- function getDisableTitleConversion() {
+ public function getDisableTitleConversion() {
return $this->mDisableTitleConversion;
}
- function getThumbSize() {
+ public function getThumbSize() {
$this->optionUsed( 'thumbsize' );
return $this->mThumbSize;
}
- function getStubThreshold() {
+ public function getStubThreshold() {
$this->optionUsed( 'stubthreshold' );
return $this->mStubThreshold;
}
- function getIsPreview() {
+ public function getIsPreview() {
return $this->mIsPreview;
}
- function getIsSectionPreview() {
+ public function getIsSectionPreview() {
return $this->mIsSectionPreview;
}
- function getIsPrintable() {
+ public function getIsPrintable() {
$this->optionUsed( 'printable' );
return $this->mIsPrintable;
}
- function getUser() {
+ public function getUser() {
return $this->mUser;
}
- function getPreSaveTransform() {
+ public function getPreSaveTransform() {
return $this->mPreSaveTransform;
}
- function getDateFormat() {
+ public function getDateFormat() {
$this->optionUsed( 'dateformat' );
if ( !isset( $this->mDateFormat ) ) {
$this->mDateFormat = $this->mUser->getDatePreference();
@@ -348,7 +348,7 @@ class ParserOptions {
return $this->mDateFormat;
}
- function getTimestamp() {
+ public function getTimestamp() {
if ( !isset( $this->mTimestamp ) ) {
$this->mTimestamp = wfTimestampNow();
}
@@ -371,7 +371,7 @@ class ParserOptions {
* @return Language
* @since 1.19
*/
- function getUserLangObj() {
+ public function getUserLangObj() {
$this->optionUsed( 'userlang' );
return $this->mUserLang;
}
@@ -382,108 +382,108 @@ class ParserOptions {
* @return string Language code
* @since 1.17
*/
- function getUserLang() {
+ public function getUserLang() {
return $this->getUserLangObj()->getCode();
}
- function setInterwikiMagic( $x ) {
+ public function setInterwikiMagic( $x ) {
return wfSetVar( $this->mInterwikiMagic, $x );
}
- function setAllowExternalImages( $x ) {
+ public function setAllowExternalImages( $x ) {
return wfSetVar( $this->mAllowExternalImages, $x );
}
- function setAllowExternalImagesFrom( $x ) {
+ public function setAllowExternalImagesFrom( $x ) {
return wfSetVar( $this->mAllowExternalImagesFrom, $x );
}
- function setEnableImageWhitelist( $x ) {
+ public function setEnableImageWhitelist( $x ) {
return wfSetVar( $this->mEnableImageWhitelist, $x );
}
- function setDateFormat( $x ) {
+ public function setDateFormat( $x ) {
return wfSetVar( $this->mDateFormat, $x );
}
- function setEditSection( $x ) {
+ public function setEditSection( $x ) {
return wfSetVar( $this->mEditSection, $x );
}
- function setNumberHeadings( $x ) {
+ public function setNumberHeadings( $x ) {
return wfSetVar( $this->mNumberHeadings, $x );
}
- function setAllowSpecialInclusion( $x ) {
+ public function setAllowSpecialInclusion( $x ) {
return wfSetVar( $this->mAllowSpecialInclusion, $x );
}
- function setTidy( $x ) {
+ public function setTidy( $x ) {
return wfSetVar( $this->mTidy, $x );
}
- function setInterfaceMessage( $x ) {
+ public function setInterfaceMessage( $x ) {
return wfSetVar( $this->mInterfaceMessage, $x );
}
- function setTargetLanguage( $x ) {
+ public function setTargetLanguage( $x ) {
return wfSetVar( $this->mTargetLanguage, $x, true );
}
- function setMaxIncludeSize( $x ) {
+ public function setMaxIncludeSize( $x ) {
return wfSetVar( $this->mMaxIncludeSize, $x );
}
- function setMaxPPNodeCount( $x ) {
+ public function setMaxPPNodeCount( $x ) {
return wfSetVar( $this->mMaxPPNodeCount, $x );
}
- function setMaxGeneratedPPNodeCount( $x ) {
+ public function setMaxGeneratedPPNodeCount( $x ) {
return wfSetVar( $this->mMaxGeneratedPPNodeCount, $x );
}
- function setMaxTemplateDepth( $x ) {
+ public function setMaxTemplateDepth( $x ) {
return wfSetVar( $this->mMaxTemplateDepth, $x );
}
/* @since 1.20 */
- function setExpensiveParserFunctionLimit( $x ) {
+ public function setExpensiveParserFunctionLimit( $x ) {
return wfSetVar( $this->mExpensiveParserFunctionLimit, $x );
}
- function setRemoveComments( $x ) {
+ public function setRemoveComments( $x ) {
return wfSetVar( $this->mRemoveComments, $x );
}
- function setTemplateCallback( $x ) {
+ public function setTemplateCallback( $x ) {
return wfSetVar( $this->mTemplateCallback, $x );
}
- function enableLimitReport( $x = true ) {
+ public function enableLimitReport( $x = true ) {
return wfSetVar( $this->mEnableLimitReport, $x );
}
- function setTimestamp( $x ) {
+ public function setTimestamp( $x ) {
return wfSetVar( $this->mTimestamp, $x );
}
- function setCleanSignatures( $x ) {
+ public function setCleanSignatures( $x ) {
return wfSetVar( $this->mCleanSignatures, $x );
}
- function setExternalLinkTarget( $x ) {
+ public function setExternalLinkTarget( $x ) {
return wfSetVar( $this->mExternalLinkTarget, $x );
}
- function disableContentConversion( $x = true ) {
+ public function disableContentConversion( $x = true ) {
return wfSetVar( $this->mDisableContentConversion, $x );
}
- function disableTitleConversion( $x = true ) {
+ public function disableTitleConversion( $x = true ) {
return wfSetVar( $this->mDisableTitleConversion, $x );
}
- function setUserLang( $x ) {
+ public function setUserLang( $x ) {
if ( is_string( $x ) ) {
$x = Language::factory( $x );
}
@@ -491,34 +491,34 @@ class ParserOptions {
return wfSetVar( $this->mUserLang, $x );
}
- function setThumbSize( $x ) {
+ public function setThumbSize( $x ) {
return wfSetVar( $this->mThumbSize, $x );
}
- function setStubThreshold( $x ) {
+ public function setStubThreshold( $x ) {
return wfSetVar( $this->mStubThreshold, $x );
}
- function setPreSaveTransform( $x ) {
+ public function setPreSaveTransform( $x ) {
return wfSetVar( $this->mPreSaveTransform, $x );
}
- function setIsPreview( $x ) {
+ public function setIsPreview( $x ) {
return wfSetVar( $this->mIsPreview, $x );
}
- function setIsSectionPreview( $x ) {
+ public function setIsSectionPreview( $x ) {
return wfSetVar( $this->mIsSectionPreview, $x );
}
- function setIsPrintable( $x ) {
+ public function setIsPrintable( $x ) {
return wfSetVar( $this->mIsPrintable, $x );
}
/**
* Extra key that should be present in the parser cache key.
*/
- function addExtraKey( $key ) {
+ public function addExtraKey( $key ) {
$this->mExtraKey .= '!' . $key;
}
@@ -527,7 +527,7 @@ class ParserOptions {
* @param User $user
* @param Language $lang
*/
- function __construct( $user = null, $lang = null ) {
+ public function __construct( $user = null, $lang = null ) {
if ( $user === null ) {
global $wgUser;
if ( $wgUser === null ) {
@@ -623,7 +623,7 @@ class ParserOptions {
* This is a private API with the parser.
* @param callable $callback
*/
- function registerWatcher( $callback ) {
+ public function registerWatcher( $callback ) {
$this->onAccessCallback = $callback;
}
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 22b127dad8f7..95c0a16a2964 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -22,7 +22,7 @@
* @ingroup Parser
*/
class ParserOutput extends CacheTime {
- var $mText, # The output text
+ public $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
@@ -61,7 +61,7 @@ class ParserOutput extends CacheTime {
const EDITSECTION_REGEX =
'#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
- function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
+ public function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
$containsOldMagic = false, $titletext = ''
) {
$this->mText = $text;
@@ -71,7 +71,7 @@ class ParserOutput extends CacheTime {
$this->mTitleText = $titletext;
}
- function getText() {
+ public function getText() {
wfProfileIn( __METHOD__ );
$text = $this->mText;
if ( $this->mEditSectionTokens ) {
@@ -102,7 +102,7 @@ class ParserOutput extends CacheTime {
* @throws MWException
* @return mixed
*/
- function replaceEditSectionLinksCallback( $m ) {
+ public function replaceEditSectionLinksCallback( $m ) {
global $wgOut, $wgLang;
$args = array(
htmlspecialchars_decode( $m[1] ),
@@ -118,181 +118,181 @@ class ParserOutput extends CacheTime {
return call_user_func_array( array( $skin, 'doEditSectionLink' ), $args );
}
- function &getLanguageLinks() {
+ public function &getLanguageLinks() {
return $this->mLanguageLinks;
}
- function getInterwikiLinks() {
+ public function getInterwikiLinks() {
return $this->mInterwikiLinks;
}
- function getCategoryLinks() {
+ public function getCategoryLinks() {
return array_keys( $this->mCategories );
}
- function &getCategories() {
+ public function &getCategories() {
return $this->mCategories;
}
- function getTitleText() {
+ public function getTitleText() {
return $this->mTitleText;
}
- function getSections() {
+ public function getSections() {
return $this->mSections;
}
- function getEditSectionTokens() {
+ public function getEditSectionTokens() {
return $this->mEditSectionTokens;
}
- function &getLinks() {
+ public function &getLinks() {
return $this->mLinks;
}
- function &getTemplates() {
+ public function &getTemplates() {
return $this->mTemplates;
}
- function &getTemplateIds() {
+ public function &getTemplateIds() {
return $this->mTemplateIds;
}
- function &getImages() {
+ public function &getImages() {
return $this->mImages;
}
- function &getFileSearchOptions() {
+ public function &getFileSearchOptions() {
return $this->mFileSearchOptions;
}
- function &getExternalLinks() {
+ public function &getExternalLinks() {
return $this->mExternalLinks;
}
- function getNoGallery() {
+ public function getNoGallery() {
return $this->mNoGallery;
}
- function getHeadItems() {
+ public function getHeadItems() {
return $this->mHeadItems;
}
- function getModules() {
+ public function getModules() {
return $this->mModules;
}
- function getModuleScripts() {
+ public function getModuleScripts() {
return $this->mModuleScripts;
}
- function getModuleStyles() {
+ public function getModuleStyles() {
return $this->mModuleStyles;
}
- function getModuleMessages() {
+ public function getModuleMessages() {
return $this->mModuleMessages;
}
/** @since 1.23 */
- function getJsConfigVars() {
+ public function getJsConfigVars() {
return $this->mJsConfigVars;
}
- function getOutputHooks() {
+ public function getOutputHooks() {
return (array)$this->mOutputHooks;
}
- function getWarnings() {
+ public function getWarnings() {
return array_keys( $this->mWarnings );
}
- function getIndexPolicy() {
+ public function getIndexPolicy() {
return $this->mIndexPolicy;
}
- function getTOCHTML() {
+ public function getTOCHTML() {
return $this->mTOCHTML;
}
- function getTimestamp() {
+ public function getTimestamp() {
return $this->mTimestamp;
}
- function getLimitReportData() {
+ public function getLimitReportData() {
return $this->mLimitReportData;
}
- function getTOCEnabled() {
+ public function getTOCEnabled() {
return $this->mTOCEnabled;
}
- function setText( $text ) {
+ public function setText( $text ) {
return wfSetVar( $this->mText, $text );
}
- function setLanguageLinks( $ll ) {
+ public function setLanguageLinks( $ll ) {
return wfSetVar( $this->mLanguageLinks, $ll );
}
- function setCategoryLinks( $cl ) {
+ public function setCategoryLinks( $cl ) {
return wfSetVar( $this->mCategories, $cl );
}
- function setTitleText( $t ) {
+ public function setTitleText( $t ) {
return wfSetVar( $this->mTitleText, $t );
}
- function setSections( $toc ) {
+ public function setSections( $toc ) {
return wfSetVar( $this->mSections, $toc );
}
- function setEditSectionTokens( $t ) {
+ public function setEditSectionTokens( $t ) {
return wfSetVar( $this->mEditSectionTokens, $t );
}
- function setIndexPolicy( $policy ) {
+ public function setIndexPolicy( $policy ) {
return wfSetVar( $this->mIndexPolicy, $policy );
}
- function setTOCHTML( $tochtml ) {
+ public function setTOCHTML( $tochtml ) {
return wfSetVar( $this->mTOCHTML, $tochtml );
}
- function setTimestamp( $timestamp ) {
+ public function setTimestamp( $timestamp ) {
return wfSetVar( $this->mTimestamp, $timestamp );
}
- function setTOCEnabled( $flag ) {
+ public function setTOCEnabled( $flag ) {
return wfSetVar( $this->mTOCEnabled, $flag );
}
- function addCategory( $c, $sort ) {
+ public function addCategory( $c, $sort ) {
$this->mCategories[$c] = $sort;
}
- function addLanguageLink( $t ) {
+ public function addLanguageLink( $t ) {
$this->mLanguageLinks[] = $t;
}
- function addWarning( $s ) {
+ public function addWarning( $s ) {
$this->mWarnings[$s] = 1;
}
- function addOutputHook( $hook, $data = false ) {
+ public function addOutputHook( $hook, $data = false ) {
$this->mOutputHooks[] = array( $hook, $data );
}
- function setNewSection( $value ) {
+ public function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
- function hideNewSection( $value ) {
+ public function hideNewSection( $value ) {
$this->mHideNewSection = (bool)$value;
}
- function getHideNewSection() {
+ public function getHideNewSection() {
return (bool)$this->mHideNewSection;
}
- function getNewSection() {
+ public function getNewSection() {
return (bool)$this->mNewSection;
}
@@ -303,7 +303,7 @@ class ParserOutput extends CacheTime {
* @param string $url The url to check
* @return bool
*/
- static function isLinkInternal( $internal, $url ) {
+ public static function isLinkInternal( $internal, $url ) {
return (bool)preg_match( '/^' .
# If server is proto relative, check also for http/https links
( substr( $internal, 0, 2 ) === '//' ? '(?:https?:)?' : '' ) .
@@ -314,7 +314,7 @@ class ParserOutput extends CacheTime {
);
}
- function addExternalLink( $url ) {
+ public function addExternalLink( $url ) {
# We don't register links pointing to our own server, unless... :-)
global $wgServer, $wgRegisterInternalExternals;
@@ -333,7 +333,7 @@ class ParserOutput extends CacheTime {
* @param Title $title
* @param int|null $id Optional known page_id so we can skip the lookup
*/
- function addLink( Title $title, $id = null ) {
+ public function addLink( Title $title, $id = null ) {
if ( $title->isExternal() ) {
// Don't record interwikis in pagelinks
$this->addInterwikiLink( $title );
@@ -368,7 +368,7 @@ class ParserOutput extends CacheTime {
* @param string $sha1 Base 36 SHA-1 of file (or false if non-existing)
* @return void
*/
- function addImage( $name, $timestamp = null, $sha1 = null ) {
+ public function addImage( $name, $timestamp = null, $sha1 = null ) {
$this->mImages[$name] = 1;
if ( $timestamp !== null && $sha1 !== null ) {
$this->mFileSearchOptions[$name] = array( 'time' => $timestamp, 'sha1' => $sha1 );
@@ -382,7 +382,7 @@ class ParserOutput extends CacheTime {
* @param int $rev_id
* @return void
*/
- function addTemplate( $title, $page_id, $rev_id ) {
+ public function addTemplate( $title, $page_id, $rev_id ) {
$ns = $title->getNamespace();
$dbk = $title->getDBkey();
if ( !isset( $this->mTemplates[$ns] ) ) {
@@ -399,7 +399,7 @@ class ParserOutput extends CacheTime {
* @param Title $title Title object, must be an interwiki link
* @throws MWException If given invalid input
*/
- function addInterwikiLink( $title ) {
+ public function addInterwikiLink( $title ) {
if ( !$title->isExternal() ) {
throw new MWException( 'Non-interwiki link passed, internal parser error.' );
}
@@ -417,7 +417,7 @@ class ParserOutput extends CacheTime {
* @param string $section
* @param string|bool $tag
*/
- function addHeadItem( $section, $tag = false ) {
+ public function addHeadItem( $section, $tag = false ) {
if ( $tag !== false ) {
$this->mHeadItems[$tag] = $section;
} else {
@@ -748,7 +748,7 @@ class ParserOutput extends CacheTime {
* Resets the parse start timestamps for future calls to getTimeSinceStart()
* @since 1.22
*/
- function resetParseStartTime() {
+ public function resetParseStartTime() {
$this->mParseStartTime = self::getTimes();
}
@@ -763,7 +763,7 @@ class ParserOutput extends CacheTime {
* @param string $clock
* @return float|null
*/
- function getTimeSinceStart( $clock ) {
+ public function getTimeSinceStart( $clock ) {
if ( !isset( $this->mParseStartTime[$clock] ) ) {
return null;
}
@@ -791,7 +791,7 @@ class ParserOutput extends CacheTime {
* @param string $key Message key
* @param mixed $value Appropriate for Message::params()
*/
- function setLimitReportData( $key, $value ) {
+ public function setLimitReportData( $key, $value ) {
$this->mLimitReportData[$key] = $value;
}
@@ -809,7 +809,7 @@ class ParserOutput extends CacheTime {
/**
* Save space for for serialization by removing useless values
*/
- function __sleep() {
+ public function __sleep() {
return array_diff(
array_keys( get_object_vars( $this ) ),
array( 'mSecondaryDataUpdates', 'mParseStartTime' )
diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php
index 335bd61ed533..77ffe9dc86c0 100644
--- a/includes/parser/Preprocessor.php
+++ b/includes/parser/Preprocessor.php
@@ -30,14 +30,14 @@ interface Preprocessor {
*
* @param Parser $parser
*/
- function __construct( $parser );
+ public function __construct( $parser );
/**
* Create a new top-level frame for expansion of a page
*
* @return PPFrame
*/
- function newFrame();
+ public function newFrame();
/**
* Create a new custom frame for programmatic use of parameter replacement
@@ -47,7 +47,7 @@ interface Preprocessor {
*
* @return PPFrame
*/
- function newCustomFrame( $args );
+ public function newCustomFrame( $args );
/**
* Create a new custom node for programmatic use of parameter replacement
@@ -55,7 +55,7 @@ interface Preprocessor {
*
* @param array $values
*/
- function newPartNodeArray( $values );
+ public function newPartNodeArray( $values );
/**
* Preprocess text to a PPNode
@@ -65,7 +65,7 @@ interface Preprocessor {
*
* @return PPNode
*/
- function preprocessToObj( $text, $flags = 0 );
+ public function preprocessToObj( $text, $flags = 0 );
}
/**
@@ -93,65 +93,65 @@ interface PPFrame {
*
* @return PPFrame
*/
- function newChild( $args = false, $title = false, $indexOffset = 0 );
+ public function newChild( $args = false, $title = false, $indexOffset = 0 );
/**
* Expand a document tree node, caching the result on its parent with the given key
*/
- function cachedExpand( $key, $root, $flags = 0 );
+ public function cachedExpand( $key, $root, $flags = 0 );
/**
* Expand a document tree node
*/
- function expand( $root, $flags = 0 );
+ public function expand( $root, $flags = 0 );
/**
* Implode with flags for expand()
*/
- function implodeWithFlags( $sep, $flags /*, ... */ );
+ public function implodeWithFlags( $sep, $flags /*, ... */ );
/**
* Implode with no flags specified
*/
- function implode( $sep /*, ... */ );
+ public function implode( $sep /*, ... */ );
/**
* Makes an object that, when expand()ed, will be the same as one obtained
* with implode()
*/
- function virtualImplode( $sep /*, ... */ );
+ public function virtualImplode( $sep /*, ... */ );
/**
* Virtual implode with brackets
*/
- function virtualBracketedImplode( $start, $sep, $end /*, ... */ );
+ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ );
/**
* Returns true if there are no arguments in this frame
*
* @return bool
*/
- function isEmpty();
+ public function isEmpty();
/**
* Returns all arguments of this frame
*/
- function getArguments();
+ public function getArguments();
/**
* Returns all numbered arguments of this frame
*/
- function getNumberedArguments();
+ public function getNumberedArguments();
/**
* Returns all named arguments of this frame
*/
- function getNamedArguments();
+ public function getNamedArguments();
/**
* Get an argument to this frame by name
*/
- function getArgument( $name );
+ public function getArgument( $name );
/**
* Returns true if the infinite loop check is OK, false if a loop is detected
@@ -159,12 +159,12 @@ interface PPFrame {
* @param Title $title
* @return bool
*/
- function loopCheck( $title );
+ public function loopCheck( $title );
/**
* Return true if the frame is a template frame
*/
- function isTemplate();
+ public function isTemplate();
/**
* Set the "volatile" flag.
@@ -177,7 +177,7 @@ interface PPFrame {
*
* @param bool $flag
*/
- function setVolatile( $flag = true );
+ public function setVolatile( $flag = true );
/**
* Get the "volatile" flag.
@@ -188,7 +188,7 @@ interface PPFrame {
* @see self::setVolatile()
* @return bool
*/
- function isVolatile();
+ public function isVolatile();
/**
* Get the TTL of the frame's output.
@@ -202,7 +202,7 @@ interface PPFrame {
*
* @return int|null
*/
- function getTTL();
+ public function getTTL();
/**
* Set the TTL of the output of this frame and all of its ancestors.
@@ -213,14 +213,14 @@ interface PPFrame {
* @see self::getTTL()
* @param int $ttl
*/
- function setTTL( $ttl );
+ public function setTTL( $ttl );
/**
* Get a title of frame
*
* @return Title
*/
- function getTitle();
+ public function getTitle();
}
/**
@@ -241,35 +241,35 @@ interface PPNode {
* Get an array-type node containing the children of this node.
* Returns false if this is not a tree node.
*/
- function getChildren();
+ public function getChildren();
/**
* Get the first child of a tree node. False if there isn't one.
*
* @return PPNode
*/
- function getFirstChild();
+ public function getFirstChild();
/**
* Get the next sibling of any node. False if there isn't one
*/
- function getNextSibling();
+ public function getNextSibling();
/**
* Get all children of this tree node which have a given name.
* Returns an array-type node, or false if this is not a tree node.
*/
- function getChildrenOfType( $type );
+ public function getChildrenOfType( $type );
/**
* Returns the length of the array, or false if this is not an array-type node
*/
- function getLength();
+ public function getLength();
/**
* Returns an item of an array-type node
*/
- function item( $i );
+ public function item( $i );
/**
* Get the name of this node. The following names are defined here:
@@ -283,7 +283,7 @@ interface PPNode {
*
* The subclass may define various other names for tree and leaf nodes.
*/
- function getName();
+ public function getName();
/**
* Split a "<part>" node into an associative array containing:
@@ -291,16 +291,16 @@ interface PPNode {
* index String index
* value PPNode value
*/
- function splitArg();
+ public function splitArg();
/**
* Split an "<ext>" node into an associative array containing name, attr, inner and close
* All values in the resulting array are PPNodes. Inner and close are optional.
*/
- function splitExt();
+ public function splitExt();
/**
* Split an "<h>" node
*/
- function splitHeading();
+ public function splitHeading();
}
diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php
index f5fc3ec669bb..f4e4dd1dda7a 100644
--- a/includes/parser/Preprocessor_DOM.php
+++ b/includes/parser/Preprocessor_DOM.php
@@ -29,13 +29,13 @@ class Preprocessor_DOM implements Preprocessor {
/**
* @var Parser
*/
- var $parser;
+ public $parser;
- var $memoryLimit;
+ public $memoryLimit;
const CACHE_VERSION = 1;
- function __construct( $parser ) {
+ public function __construct( $parser ) {
$this->parser = $parser;
$mem = ini_get( 'memory_limit' );
$this->memoryLimit = false;
@@ -51,7 +51,7 @@ class Preprocessor_DOM implements Preprocessor {
/**
* @return PPFrame_DOM
*/
- function newFrame() {
+ public function newFrame() {
return new PPFrame_DOM( $this );
}
@@ -59,7 +59,7 @@ class Preprocessor_DOM implements Preprocessor {
* @param array $args
* @return PPCustomFrame_DOM
*/
- function newCustomFrame( $args ) {
+ public function newCustomFrame( $args ) {
return new PPCustomFrame_DOM( $this, $args );
}
@@ -67,7 +67,7 @@ class Preprocessor_DOM implements Preprocessor {
* @param array $values
* @return PPNode_DOM
*/
- function newPartNodeArray( $values ) {
+ public function newPartNodeArray( $values ) {
//NOTE: DOM manipulation is slower than building & parsing XML! (or so Tim sais)
$xml = "<list>";
@@ -110,7 +110,7 @@ class Preprocessor_DOM implements Preprocessor {
* @throws MWException
* @return bool
*/
- function memCheck() {
+ public function memCheck() {
if ( $this->memoryLimit === false ) {
return true;
}
@@ -146,7 +146,7 @@ class Preprocessor_DOM implements Preprocessor {
* @throws MWException
* @return PPNode_DOM
*/
- function preprocessToObj( $text, $flags = 0 ) {
+ public function preprocessToObj( $text, $flags = 0 ) {
wfProfileIn( __METHOD__ );
global $wgMemc, $wgPreprocessorCacheThreshold;
@@ -224,7 +224,7 @@ class Preprocessor_DOM implements Preprocessor {
* @param int $flags
* @return string
*/
- function preprocessToXml( $text, $flags = 0 ) {
+ public function preprocessToXml( $text, $flags = 0 ) {
wfProfileIn( __METHOD__ );
$rules = array(
'{' => array(
@@ -773,18 +773,18 @@ class Preprocessor_DOM implements Preprocessor {
* @ingroup Parser
*/
class PPDStack {
- var $stack, $rootAccum;
+ public $stack, $rootAccum;
/**
* @var PPDStack
*/
- var $top;
- var $out;
- var $elementClass = 'PPDStackElement';
+ public $top;
+ public $out;
+ public $elementClass = 'PPDStackElement';
- static $false = false;
+ public static $false = false;
- function __construct() {
+ public function __construct() {
$this->stack = array();
$this->top = false;
$this->rootAccum = '';
@@ -794,15 +794,15 @@ class PPDStack {
/**
* @return int
*/
- function count() {
+ public function count() {
return count( $this->stack );
}
- function &getAccum() {
+ public function &getAccum() {
return $this->accum;
}
- function getCurrentPart() {
+ public function getCurrentPart() {
if ( $this->top === false ) {
return false;
} else {
@@ -810,7 +810,7 @@ class PPDStack {
}
}
- function push( $data ) {
+ public function push( $data ) {
if ( $data instanceof $this->elementClass ) {
$this->stack[] = $data;
} else {
@@ -821,7 +821,7 @@ class PPDStack {
$this->accum =& $this->top->getAccum();
}
- function pop() {
+ public function pop() {
if ( !count( $this->stack ) ) {
throw new MWException( __METHOD__ . ': no elements remaining' );
}
@@ -837,7 +837,7 @@ class PPDStack {
return $temp;
}
- function addPart( $s = '' ) {
+ public function addPart( $s = '' ) {
$this->top->addPart( $s );
$this->accum =& $this->top->getAccum();
}
@@ -845,7 +845,7 @@ class PPDStack {
/**
* @return array
*/
- function getFlags() {
+ public function getFlags() {
if ( !count( $this->stack ) ) {
return array(
'findEquals' => false,
@@ -862,15 +862,15 @@ class PPDStack {
* @ingroup Parser
*/
class PPDStackElement {
- var $open, // Opening character (\n for heading)
+ public $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 $partClass = 'PPDPart';
+ public $partClass = 'PPDPart';
- function __construct( $data = array() ) {
+ public function __construct( $data = array() ) {
$class = $this->partClass;
$this->parts = array( new $class );
@@ -879,23 +879,23 @@ class PPDStackElement {
}
}
- function &getAccum() {
+ public function &getAccum() {
return $this->parts[count( $this->parts ) - 1]->out;
}
- function addPart( $s = '' ) {
+ public function addPart( $s = '' ) {
$class = $this->partClass;
$this->parts[] = new $class( $s );
}
- function getCurrentPart() {
+ public function getCurrentPart() {
return $this->parts[count( $this->parts ) - 1];
}
/**
* @return array
*/
- function getFlags() {
+ public function getFlags() {
$partCount = count( $this->parts );
$findPipe = $this->open != "\n" && $this->open != '[';
return array(
@@ -911,7 +911,7 @@ class PPDStackElement {
* @param bool|int $openingCount
* @return string
*/
- function breakSyntax( $openingCount = false ) {
+ public function breakSyntax( $openingCount = false ) {
if ( $this->open == "\n" ) {
$s = $this->parts[0]->out;
} else {
@@ -937,14 +937,14 @@ class PPDStackElement {
* @ingroup Parser
*/
class PPDPart {
- var $out; // Output accumulator string
+ public $out; // Output accumulator string
// Optional member variables:
// eqpos Position of equals sign in output accumulator
// commentEnd Past-the-end input pointer for the last comment encountered
// visualEnd Past-the-end input pointer for the end of the accumulator minus comments
- function __construct( $out = '' ) {
+ public function __construct( $out = '' ) {
$this->out = $out;
}
}
@@ -958,30 +958,30 @@ class PPFrame_DOM implements PPFrame {
/**
* @var Preprocessor
*/
- var $preprocessor;
+ public $preprocessor;
/**
* @var Parser
*/
- var $parser;
+ public $parser;
/**
* @var Title
*/
- var $title;
- var $titleCache;
+ public $title;
+ public $titleCache;
/**
* Hashtable listing templates which are disallowed for expansion in this frame,
* having been encountered previously in parent frames.
*/
- var $loopCheckHash;
+ public $loopCheckHash;
/**
* Recursion depth of this frame, top = 0
* Note that this is NOT the same as expansion depth in expand()
*/
- var $depth;
+ public $depth;
private $volatile = false;
private $ttl = null;
@@ -995,7 +995,7 @@ class PPFrame_DOM implements PPFrame {
* Construct a new preprocessor frame.
* @param Preprocessor $preprocessor The parent preprocessor
*/
- function __construct( $preprocessor ) {
+ public function __construct( $preprocessor ) {
$this->preprocessor = $preprocessor;
$this->parser = $preprocessor->parser;
$this->title = $this->parser->mTitle;
@@ -1014,7 +1014,7 @@ class PPFrame_DOM implements PPFrame {
* @param int $indexOffset
* @return PPTemplateFrame_DOM
*/
- function newChild( $args = false, $title = false, $indexOffset = 0 ) {
+ public function newChild( $args = false, $title = false, $indexOffset = 0 ) {
$namedArgs = array();
$numberedArgs = array();
if ( $title === false ) {
@@ -1059,7 +1059,7 @@ class PPFrame_DOM implements PPFrame {
* @param int $flags
* @return string
*/
- function cachedExpand( $key, $root, $flags = 0 ) {
+ public function cachedExpand( $key, $root, $flags = 0 ) {
// we don't have a parent, so we don't have a cache
return $this->expand( $root, $flags );
}
@@ -1070,7 +1070,7 @@ class PPFrame_DOM implements PPFrame {
* @param int $flags
* @return string
*/
- function expand( $root, $flags = 0 ) {
+ public function expand( $root, $flags = 0 ) {
static $expansionDepth = 0;
if ( is_string( $root ) ) {
return $root;
@@ -1313,7 +1313,7 @@ class PPFrame_DOM implements PPFrame {
* @param int $flags
* @return string
*/
- function implodeWithFlags( $sep, $flags /*, ... */ ) {
+ public function implodeWithFlags( $sep, $flags /*, ... */ ) {
$args = array_slice( func_get_args(), 2 );
$first = true;
@@ -1344,7 +1344,7 @@ class PPFrame_DOM implements PPFrame {
* @param string $sep
* @return string
*/
- function implode( $sep /*, ... */ ) {
+ public function implode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
$first = true;
@@ -1375,7 +1375,7 @@ class PPFrame_DOM implements PPFrame {
* @param string $sep
* @return array
*/
- function virtualImplode( $sep /*, ... */ ) {
+ public function virtualImplode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
$out = array();
$first = true;
@@ -1406,7 +1406,7 @@ class PPFrame_DOM implements PPFrame {
* @param string $end
* @return array
*/
- function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
+ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
$args = array_slice( func_get_args(), 3 );
$out = array( $start );
$first = true;
@@ -1431,11 +1431,11 @@ class PPFrame_DOM implements PPFrame {
return $out;
}
- function __toString() {
+ public function __toString() {
return 'frame{}';
}
- function getPDBK( $level = false ) {
+ public function getPDBK( $level = false ) {
if ( $level === false ) {
return $this->title->getPrefixedDBkey();
} else {
@@ -1446,21 +1446,21 @@ class PPFrame_DOM implements PPFrame {
/**
* @return array
*/
- function getArguments() {
+ public function getArguments() {
return array();
}
/**
* @return array
*/
- function getNumberedArguments() {
+ public function getNumberedArguments() {
return array();
}
/**
* @return array
*/
- function getNamedArguments() {
+ public function getNamedArguments() {
return array();
}
@@ -1469,11 +1469,11 @@ class PPFrame_DOM implements PPFrame {
*
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return true;
}
- function getArgument( $name ) {
+ public function getArgument( $name ) {
return false;
}
@@ -1483,7 +1483,7 @@ class PPFrame_DOM implements PPFrame {
* @param Title $title
* @return bool
*/
- function loopCheck( $title ) {
+ public function loopCheck( $title ) {
return !isset( $this->loopCheckHash[$title->getPrefixedDBkey()] );
}
@@ -1492,7 +1492,7 @@ class PPFrame_DOM implements PPFrame {
*
* @return bool
*/
- function isTemplate() {
+ public function isTemplate() {
return false;
}
@@ -1501,7 +1501,7 @@ class PPFrame_DOM implements PPFrame {
*
* @return Title
*/
- function getTitle() {
+ public function getTitle() {
return $this->title;
}
@@ -1510,7 +1510,7 @@ class PPFrame_DOM implements PPFrame {
*
* @param bool $flag
*/
- function setVolatile( $flag = true ) {
+ public function setVolatile( $flag = true ) {
$this->volatile = $flag;
}
@@ -1519,7 +1519,7 @@ class PPFrame_DOM implements PPFrame {
*
* @return bool
*/
- function isVolatile() {
+ public function isVolatile() {
return $this->volatile;
}
@@ -1528,7 +1528,7 @@ class PPFrame_DOM implements PPFrame {
*
* @param int $ttl
*/
- function setTTL( $ttl ) {
+ public function setTTL( $ttl ) {
if ( $ttl !== null && ( $this->ttl === null || $ttl < $this->ttl ) ) {
$this->ttl = $ttl;
}
@@ -1539,7 +1539,7 @@ class PPFrame_DOM implements PPFrame {
*
* @return int|null
*/
- function getTTL() {
+ public function getTTL() {
return $this->ttl;
}
}
@@ -1549,13 +1549,13 @@ class PPFrame_DOM implements PPFrame {
* @ingroup Parser
*/
class PPTemplateFrame_DOM extends PPFrame_DOM {
- var $numberedArgs, $namedArgs;
+ public $numberedArgs, $namedArgs;
/**
* @var PPFrame_DOM
*/
- var $parent;
- var $numberedExpansionCache, $namedExpansionCache;
+ public $parent;
+ public $numberedExpansionCache, $namedExpansionCache;
/**
* @param Preprocessor $preprocessor
@@ -1564,7 +1564,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
* @param array $namedArgs
* @param bool|Title $title
*/
- function __construct( $preprocessor, $parent = false, $numberedArgs = array(),
+ public function __construct( $preprocessor, $parent = false, $numberedArgs = array(),
$namedArgs = array(), $title = false
) {
parent::__construct( $preprocessor );
@@ -1584,7 +1584,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
$this->numberedExpansionCache = $this->namedExpansionCache = array();
}
- function __toString() {
+ public function __toString() {
$s = 'tplframe{';
$first = true;
$args = $this->numberedArgs + $this->namedArgs;
@@ -1608,7 +1608,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
* @param int $flags
* @return string
*/
- function cachedExpand( $key, $root, $flags = 0 ) {
+ public function cachedExpand( $key, $root, $flags = 0 ) {
if ( isset( $this->parent->childExpansionCache[$key] ) ) {
return $this->parent->childExpansionCache[$key];
}
@@ -1624,11 +1624,11 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
*
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return !count( $this->numberedArgs ) && !count( $this->namedArgs );
}
- function getArguments() {
+ public function getArguments() {
$arguments = array();
foreach ( array_merge(
array_keys( $this->numberedArgs ),
@@ -1638,7 +1638,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
return $arguments;
}
- function getNumberedArguments() {
+ public function getNumberedArguments() {
$arguments = array();
foreach ( array_keys( $this->numberedArgs ) as $key ) {
$arguments[$key] = $this->getArgument( $key );
@@ -1646,7 +1646,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
return $arguments;
}
- function getNamedArguments() {
+ public function getNamedArguments() {
$arguments = array();
foreach ( array_keys( $this->namedArgs ) as $key ) {
$arguments[$key] = $this->getArgument( $key );
@@ -1654,7 +1654,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
return $arguments;
}
- function getNumberedArgument( $index ) {
+ public function getNumberedArgument( $index ) {
if ( !isset( $this->numberedArgs[$index] ) ) {
return false;
}
@@ -1668,7 +1668,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
return $this->numberedExpansionCache[$index];
}
- function getNamedArgument( $name ) {
+ public function getNamedArgument( $name ) {
if ( !isset( $this->namedArgs[$name] ) ) {
return false;
}
@@ -1680,7 +1680,7 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
return $this->namedExpansionCache[$name];
}
- function getArgument( $name ) {
+ public function getArgument( $name ) {
$text = $this->getNumberedArgument( $name );
if ( $text === false ) {
$text = $this->getNamedArgument( $name );
@@ -1693,16 +1693,16 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
*
* @return bool
*/
- function isTemplate() {
+ public function isTemplate() {
return true;
}
- function setVolatile( $flag = true ) {
+ public function setVolatile( $flag = true ) {
parent::setVolatile( $flag );
$this->parent->setVolatile( $flag );
}
- function setTTL( $ttl ) {
+ public function setTTL( $ttl ) {
parent::setTTL( $ttl );
$this->parent->setTTL( $ttl );
}
@@ -1713,14 +1713,14 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
* @ingroup Parser
*/
class PPCustomFrame_DOM extends PPFrame_DOM {
- var $args;
+ public $args;
- function __construct( $preprocessor, $args ) {
+ public function __construct( $preprocessor, $args ) {
parent::__construct( $preprocessor );
$this->args = $args;
}
- function __toString() {
+ public function __toString() {
$s = 'cstmframe{';
$first = true;
foreach ( $this->args as $name => $value ) {
@@ -1739,18 +1739,18 @@ class PPCustomFrame_DOM extends PPFrame_DOM {
/**
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return !count( $this->args );
}
- function getArgument( $index ) {
+ public function getArgument( $index ) {
if ( !isset( $this->args[$index] ) ) {
return false;
}
return $this->args[$index];
}
- function getArguments() {
+ public function getArguments() {
return $this->args;
}
}
@@ -1763,24 +1763,24 @@ class PPNode_DOM implements PPNode {
/**
* @var DOMElement
*/
- var $node;
- var $xpath;
+ public $node;
+ public $xpath;
- function __construct( $node, $xpath = false ) {
+ public function __construct( $node, $xpath = false ) {
$this->node = $node;
}
/**
* @return DOMXPath
*/
- function getXPath() {
+ public function getXPath() {
if ( $this->xpath === null ) {
$this->xpath = new DOMXPath( $this->node->ownerDocument );
}
return $this->xpath;
}
- function __toString() {
+ public function __toString() {
if ( $this->node instanceof DOMNodeList ) {
$s = '';
foreach ( $this->node as $node ) {
@@ -1795,21 +1795,21 @@ class PPNode_DOM implements PPNode {
/**
* @return bool|PPNode_DOM
*/
- function getChildren() {
+ public function getChildren() {
return $this->node->childNodes ? new self( $this->node->childNodes ) : false;
}
/**
* @return bool|PPNode_DOM
*/
- function getFirstChild() {
+ public function getFirstChild() {
return $this->node->firstChild ? new self( $this->node->firstChild ) : false;
}
/**
* @return bool|PPNode_DOM
*/
- function getNextSibling() {
+ public function getNextSibling() {
return $this->node->nextSibling ? new self( $this->node->nextSibling ) : false;
}
@@ -1818,14 +1818,14 @@ class PPNode_DOM implements PPNode {
*
* @return bool|PPNode_DOM
*/
- function getChildrenOfType( $type ) {
+ public function getChildrenOfType( $type ) {
return new self( $this->getXPath()->query( $type, $this->node ) );
}
/**
* @return int
*/
- function getLength() {
+ public function getLength() {
if ( $this->node instanceof DOMNodeList ) {
return $this->node->length;
} else {
@@ -1837,7 +1837,7 @@ class PPNode_DOM implements PPNode {
* @param int $i
* @return bool|PPNode_DOM
*/
- function item( $i ) {
+ public function item( $i ) {
$item = $this->node->item( $i );
return $item ? new self( $item ) : false;
}
@@ -1845,7 +1845,7 @@ class PPNode_DOM implements PPNode {
/**
* @return string
*/
- function getName() {
+ public function getName() {
if ( $this->node instanceof DOMNodeList ) {
return '#nodelist';
} else {
@@ -1862,7 +1862,7 @@ class PPNode_DOM implements PPNode {
* @throws MWException
* @return array
*/
- function splitArg() {
+ public function splitArg() {
$xpath = $this->getXPath();
$names = $xpath->query( 'name', $this->node );
$values = $xpath->query( 'value', $this->node );
@@ -1884,7 +1884,7 @@ class PPNode_DOM implements PPNode {
* @throws MWException
* @return array
*/
- function splitExt() {
+ public function splitExt() {
$xpath = $this->getXPath();
$names = $xpath->query( 'name', $this->node );
$attrs = $xpath->query( 'attr', $this->node );
@@ -1910,7 +1910,7 @@ class PPNode_DOM implements PPNode {
* @throws MWException
* @return array
*/
- function splitHeading() {
+ public function splitHeading() {
if ( $this->getName() !== 'h' ) {
throw new MWException( 'Invalid h node passed to ' . __METHOD__ );
}
diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php
index 26daca18ca89..d7f5953a85e6 100644
--- a/includes/parser/Preprocessor_Hash.php
+++ b/includes/parser/Preprocessor_Hash.php
@@ -28,21 +28,22 @@
* @ingroup Parser
*/
class Preprocessor_Hash implements Preprocessor {
+
/**
* @var Parser
*/
- var $parser;
+ public $parser;
const CACHE_VERSION = 1;
- function __construct( $parser ) {
+ public function __construct( $parser ) {
$this->parser = $parser;
}
/**
* @return PPFrame_Hash
*/
- function newFrame() {
+ public function newFrame() {
return new PPFrame_Hash( $this );
}
@@ -50,7 +51,7 @@ class Preprocessor_Hash implements Preprocessor {
* @param array $args
* @return PPCustomFrame_Hash
*/
- function newCustomFrame( $args ) {
+ public function newCustomFrame( $args ) {
return new PPCustomFrame_Hash( $this, $args );
}
@@ -58,7 +59,7 @@ class Preprocessor_Hash implements Preprocessor {
* @param array $values
* @return PPNode_Hash_Array
*/
- function newPartNodeArray( $values ) {
+ public function newPartNodeArray( $values ) {
$list = array();
foreach ( $values as $k => $val ) {
@@ -108,7 +109,7 @@ class Preprocessor_Hash implements Preprocessor {
* @throws MWException
* @return PPNode_Hash_Tree
*/
- function preprocessToObj( $text, $flags = 0 ) {
+ public function preprocessToObj( $text, $flags = 0 ) {
wfProfileIn( __METHOD__ );
// Check cache.
@@ -760,7 +761,7 @@ class Preprocessor_Hash implements Preprocessor {
* @ingroup Parser
*/
class PPDStack_Hash extends PPDStack {
- function __construct() {
+ public function __construct() {
$this->elementClass = 'PPDStackElement_Hash';
parent::__construct();
$this->rootAccum = new PPDAccum_Hash;
@@ -771,7 +772,7 @@ class PPDStack_Hash extends PPDStack {
* @ingroup Parser
*/
class PPDStackElement_Hash extends PPDStackElement {
- function __construct( $data = array() ) {
+ public function __construct( $data = array() ) {
$this->partClass = 'PPDPart_Hash';
parent::__construct( $data );
}
@@ -782,7 +783,7 @@ class PPDStackElement_Hash extends PPDStackElement {
* @param int|bool $openingCount
* @return PPDAccum_Hash
*/
- function breakSyntax( $openingCount = false ) {
+ public function breakSyntax( $openingCount = false ) {
if ( $this->open == "\n" ) {
$accum = $this->parts[0]->out;
} else {
@@ -809,7 +810,7 @@ class PPDStackElement_Hash extends PPDStackElement {
* @ingroup Parser
*/
class PPDPart_Hash extends PPDPart {
- function __construct( $out = '' ) {
+ public function __construct( $out = '' ) {
$accum = new PPDAccum_Hash;
if ( $out !== '' ) {
$accum->addLiteral( $out );
@@ -822,9 +823,9 @@ class PPDPart_Hash extends PPDPart {
* @ingroup Parser
*/
class PPDAccum_Hash {
- var $firstNode, $lastNode;
+ public $firstNode, $lastNode;
- function __construct() {
+ public function __construct() {
$this->firstNode = $this->lastNode = false;
}
@@ -832,7 +833,7 @@ class PPDAccum_Hash {
* Append a string literal
* @param string $s
*/
- function addLiteral( $s ) {
+ public function addLiteral( $s ) {
if ( $this->lastNode === false ) {
$this->firstNode = $this->lastNode = new PPNode_Hash_Text( $s );
} elseif ( $this->lastNode instanceof PPNode_Hash_Text ) {
@@ -847,7 +848,7 @@ class PPDAccum_Hash {
* Append a PPNode
* @param PPNode $node
*/
- function addNode( PPNode $node ) {
+ public function addNode( PPNode $node ) {
if ( $this->lastNode === false ) {
$this->firstNode = $this->lastNode = $node;
} else {
@@ -861,7 +862,7 @@ class PPDAccum_Hash {
* @param string $name
* @param string $value
*/
- function addNodeWithText( $name, $value ) {
+ public function addNodeWithText( $name, $value ) {
$node = PPNode_Hash_Tree::newWithText( $name, $value );
$this->addNode( $node );
}
@@ -872,7 +873,7 @@ class PPDAccum_Hash {
* subsequently be modified, especially nextSibling.
* @param PPDAccum_Hash $accum
*/
- function addAccum( $accum ) {
+ public function addAccum( $accum ) {
if ( $accum->lastNode === false ) {
// nothing to add
} elseif ( $this->lastNode === false ) {
@@ -894,30 +895,30 @@ class PPFrame_Hash implements PPFrame {
/**
* @var Parser
*/
- var $parser;
+ public $parser;
/**
* @var Preprocessor
*/
- var $preprocessor;
+ public $preprocessor;
/**
* @var Title
*/
- var $title;
- var $titleCache;
+ public $title;
+ public $titleCache;
/**
* Hashtable listing templates which are disallowed for expansion in this frame,
* having been encountered previously in parent frames.
*/
- var $loopCheckHash;
+ public $loopCheckHash;
/**
* Recursion depth of this frame, top = 0
* Note that this is NOT the same as expansion depth in expand()
*/
- var $depth;
+ public $depth;
private $volatile = false;
private $ttl = null;
@@ -931,7 +932,7 @@ class PPFrame_Hash implements PPFrame {
* Construct a new preprocessor frame.
* @param Preprocessor $preprocessor The parent preprocessor
*/
- function __construct( $preprocessor ) {
+ public function __construct( $preprocessor ) {
$this->preprocessor = $preprocessor;
$this->parser = $preprocessor->parser;
$this->title = $this->parser->mTitle;
@@ -951,7 +952,7 @@ class PPFrame_Hash implements PPFrame {
* @throws MWException
* @return PPTemplateFrame_Hash
*/
- function newChild( $args = false, $title = false, $indexOffset = 0 ) {
+ public function newChild( $args = false, $title = false, $indexOffset = 0 ) {
$namedArgs = array();
$numberedArgs = array();
if ( $title === false ) {
@@ -988,7 +989,7 @@ class PPFrame_Hash implements PPFrame {
* @param int $flags
* @return string
*/
- function cachedExpand( $key, $root, $flags = 0 ) {
+ public function cachedExpand( $key, $root, $flags = 0 ) {
// we don't have a parent, so we don't have a cache
return $this->expand( $root, $flags );
}
@@ -999,7 +1000,7 @@ class PPFrame_Hash implements PPFrame {
* @param int $flags
* @return string
*/
- function expand( $root, $flags = 0 ) {
+ public function expand( $root, $flags = 0 ) {
static $expansionDepth = 0;
if ( is_string( $root ) ) {
return $root;
@@ -1209,7 +1210,7 @@ class PPFrame_Hash implements PPFrame {
* @param int $flags
* @return string
*/
- function implodeWithFlags( $sep, $flags /*, ... */ ) {
+ public function implodeWithFlags( $sep, $flags /*, ... */ ) {
$args = array_slice( func_get_args(), 2 );
$first = true;
@@ -1239,7 +1240,7 @@ class PPFrame_Hash implements PPFrame {
* @param string $sep
* @return string
*/
- function implode( $sep /*, ... */ ) {
+ public function implode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
$first = true;
@@ -1270,7 +1271,7 @@ class PPFrame_Hash implements PPFrame {
* @param string $sep
* @return PPNode_Hash_Array
*/
- function virtualImplode( $sep /*, ... */ ) {
+ public function virtualImplode( $sep /*, ... */ ) {
$args = array_slice( func_get_args(), 1 );
$out = array();
$first = true;
@@ -1302,7 +1303,7 @@ class PPFrame_Hash implements PPFrame {
* @param string $end
* @return PPNode_Hash_Array
*/
- function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
+ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
$args = array_slice( func_get_args(), 3 );
$out = array( $start );
$first = true;
@@ -1327,7 +1328,7 @@ class PPFrame_Hash implements PPFrame {
return new PPNode_Hash_Array( $out );
}
- function __toString() {
+ public function __toString() {
return 'frame{}';
}
@@ -1335,7 +1336,7 @@ class PPFrame_Hash implements PPFrame {
* @param bool $level
* @return array|bool|string
*/
- function getPDBK( $level = false ) {
+ public function getPDBK( $level = false ) {
if ( $level === false ) {
return $this->title->getPrefixedDBkey();
} else {
@@ -1346,21 +1347,21 @@ class PPFrame_Hash implements PPFrame {
/**
* @return array
*/
- function getArguments() {
+ public function getArguments() {
return array();
}
/**
* @return array
*/
- function getNumberedArguments() {
+ public function getNumberedArguments() {
return array();
}
/**
* @return array
*/
- function getNamedArguments() {
+ public function getNamedArguments() {
return array();
}
@@ -1369,7 +1370,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return true;
}
@@ -1377,7 +1378,7 @@ class PPFrame_Hash implements PPFrame {
* @param string $name
* @return bool
*/
- function getArgument( $name ) {
+ public function getArgument( $name ) {
return false;
}
@@ -1388,7 +1389,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return bool
*/
- function loopCheck( $title ) {
+ public function loopCheck( $title ) {
return !isset( $this->loopCheckHash[$title->getPrefixedDBkey()] );
}
@@ -1397,7 +1398,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return bool
*/
- function isTemplate() {
+ public function isTemplate() {
return false;
}
@@ -1406,7 +1407,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return Title
*/
- function getTitle() {
+ public function getTitle() {
return $this->title;
}
@@ -1415,7 +1416,7 @@ class PPFrame_Hash implements PPFrame {
*
* @param bool $flag
*/
- function setVolatile( $flag = true ) {
+ public function setVolatile( $flag = true ) {
$this->volatile = $flag;
}
@@ -1424,7 +1425,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return bool
*/
- function isVolatile() {
+ public function isVolatile() {
return $this->volatile;
}
@@ -1433,7 +1434,7 @@ class PPFrame_Hash implements PPFrame {
*
* @param int $ttl
*/
- function setTTL( $ttl ) {
+ public function setTTL( $ttl ) {
if ( $ttl !== null && ( $this->ttl === null || $ttl < $this->ttl ) ) {
$this->ttl = $ttl;
}
@@ -1444,7 +1445,7 @@ class PPFrame_Hash implements PPFrame {
*
* @return int|null
*/
- function getTTL() {
+ public function getTTL() {
return $this->ttl;
}
}
@@ -1454,8 +1455,8 @@ class PPFrame_Hash implements PPFrame {
* @ingroup Parser
*/
class PPTemplateFrame_Hash extends PPFrame_Hash {
- var $numberedArgs, $namedArgs, $parent;
- var $numberedExpansionCache, $namedExpansionCache;
+ public $numberedArgs, $namedArgs, $parent;
+ public $numberedExpansionCache, $namedExpansionCache;
/**
* @param Preprocessor $preprocessor
@@ -1464,7 +1465,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @param array $namedArgs
* @param bool|Title $title
*/
- function __construct( $preprocessor, $parent = false, $numberedArgs = array(),
+ public function __construct( $preprocessor, $parent = false, $numberedArgs = array(),
$namedArgs = array(), $title = false
) {
parent::__construct( $preprocessor );
@@ -1484,7 +1485,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
$this->numberedExpansionCache = $this->namedExpansionCache = array();
}
- function __toString() {
+ public function __toString() {
$s = 'tplframe{';
$first = true;
$args = $this->numberedArgs + $this->namedArgs;
@@ -1508,7 +1509,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @param int $flags
* @return string
*/
- function cachedExpand( $key, $root, $flags = 0 ) {
+ public function cachedExpand( $key, $root, $flags = 0 ) {
if ( isset( $this->parent->childExpansionCache[$key] ) ) {
return $this->parent->childExpansionCache[$key];
}
@@ -1524,14 +1525,14 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
*
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return !count( $this->numberedArgs ) && !count( $this->namedArgs );
}
/**
* @return array
*/
- function getArguments() {
+ public function getArguments() {
$arguments = array();
foreach ( array_merge(
array_keys( $this->numberedArgs ),
@@ -1544,7 +1545,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
/**
* @return array
*/
- function getNumberedArguments() {
+ public function getNumberedArguments() {
$arguments = array();
foreach ( array_keys( $this->numberedArgs ) as $key ) {
$arguments[$key] = $this->getArgument( $key );
@@ -1555,7 +1556,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
/**
* @return array
*/
- function getNamedArguments() {
+ public function getNamedArguments() {
$arguments = array();
foreach ( array_keys( $this->namedArgs ) as $key ) {
$arguments[$key] = $this->getArgument( $key );
@@ -1567,7 +1568,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @param int $index
* @return array|bool
*/
- function getNumberedArgument( $index ) {
+ public function getNumberedArgument( $index ) {
if ( !isset( $this->numberedArgs[$index] ) ) {
return false;
}
@@ -1585,7 +1586,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @param string $name
* @return bool
*/
- function getNamedArgument( $name ) {
+ public function getNamedArgument( $name ) {
if ( !isset( $this->namedArgs[$name] ) ) {
return false;
}
@@ -1601,7 +1602,7 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @param string $name
* @return array|bool
*/
- function getArgument( $name ) {
+ public function getArgument( $name ) {
$text = $this->getNumberedArgument( $name );
if ( $text === false ) {
$text = $this->getNamedArgument( $name );
@@ -1614,16 +1615,16 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
*
* @return bool
*/
- function isTemplate() {
+ public function isTemplate() {
return true;
}
- function setVolatile( $flag = true ) {
+ public function setVolatile( $flag = true ) {
parent::setVolatile( $flag );
$this->parent->setVolatile( $flag );
}
- function setTTL( $ttl ) {
+ public function setTTL( $ttl ) {
parent::setTTL( $ttl );
$this->parent->setTTL( $ttl );
}
@@ -1634,14 +1635,14 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
* @ingroup Parser
*/
class PPCustomFrame_Hash extends PPFrame_Hash {
- var $args;
+ public $args;
- function __construct( $preprocessor, $args ) {
+ public function __construct( $preprocessor, $args ) {
parent::__construct( $preprocessor );
$this->args = $args;
}
- function __toString() {
+ public function __toString() {
$s = 'cstmframe{';
$first = true;
foreach ( $this->args as $name => $value ) {
@@ -1660,7 +1661,7 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
/**
* @return bool
*/
- function isEmpty() {
+ public function isEmpty() {
return !count( $this->args );
}
@@ -1668,14 +1669,14 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
* @param int $index
* @return bool
*/
- function getArgument( $index ) {
+ public function getArgument( $index ) {
if ( !isset( $this->args[$index] ) ) {
return false;
}
return $this->args[$index];
}
- function getArguments() {
+ public function getArguments() {
return $this->args;
}
}
@@ -1684,14 +1685,14 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
* @ingroup Parser
*/
class PPNode_Hash_Tree implements PPNode {
- var $name, $firstChild, $lastChild, $nextSibling;
+ public $name, $firstChild, $lastChild, $nextSibling;
- function __construct( $name ) {
+ public function __construct( $name ) {
$this->name = $name;
$this->firstChild = $this->lastChild = $this->nextSibling = false;
}
- function __toString() {
+ public function __toString() {
$inner = '';
$attribs = '';
for ( $node = $this->firstChild; $node; $node = $node->nextSibling ) {
@@ -1713,13 +1714,13 @@ class PPNode_Hash_Tree implements PPNode {
* @param string $text
* @return PPNode_Hash_Tree
*/
- static function newWithText( $name, $text ) {
+ public static function newWithText( $name, $text ) {
$obj = new self( $name );
$obj->addChild( new PPNode_Hash_Text( $text ) );
return $obj;
}
- function addChild( $node ) {
+ public function addChild( $node ) {
if ( $this->lastChild === false ) {
$this->firstChild = $this->lastChild = $node;
} else {
@@ -1731,7 +1732,7 @@ class PPNode_Hash_Tree implements PPNode {
/**
* @return PPNode_Hash_Array
*/
- function getChildren() {
+ public function getChildren() {
$children = array();
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
$children[] = $child;
@@ -1739,15 +1740,15 @@ class PPNode_Hash_Tree implements PPNode {
return new PPNode_Hash_Array( $children );
}
- function getFirstChild() {
+ public function getFirstChild() {
return $this->firstChild;
}
- function getNextSibling() {
+ public function getNextSibling() {
return $this->nextSibling;
}
- function getChildrenOfType( $name ) {
+ public function getChildrenOfType( $name ) {
$children = array();
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
if ( isset( $child->name ) && $child->name === $name ) {
@@ -1760,7 +1761,7 @@ class PPNode_Hash_Tree implements PPNode {
/**
* @return bool
*/
- function getLength() {
+ public function getLength() {
return false;
}
@@ -1768,14 +1769,14 @@ class PPNode_Hash_Tree implements PPNode {
* @param int $i
* @return bool
*/
- function item( $i ) {
+ public function item( $i ) {
return false;
}
/**
* @return string
*/
- function getName() {
+ public function getName() {
return $this->name;
}
@@ -1788,7 +1789,7 @@ class PPNode_Hash_Tree implements PPNode {
* @throws MWException
* @return array
*/
- function splitArg() {
+ public function splitArg() {
$bits = array();
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
if ( !isset( $child->name ) ) {
@@ -1822,7 +1823,7 @@ class PPNode_Hash_Tree implements PPNode {
* @throws MWException
* @return array
*/
- function splitExt() {
+ public function splitExt() {
$bits = array();
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
if ( !isset( $child->name ) ) {
@@ -1850,7 +1851,7 @@ class PPNode_Hash_Tree implements PPNode {
* @throws MWException
* @return array
*/
- function splitHeading() {
+ public function splitHeading() {
if ( $this->name !== 'h' ) {
throw new MWException( 'Invalid h node passed to ' . __METHOD__ );
}
@@ -1877,7 +1878,7 @@ class PPNode_Hash_Tree implements PPNode {
* @throws MWException
* @return array
*/
- function splitTemplate() {
+ public function splitTemplate() {
$parts = array();
$bits = array( 'lineStart' => '' );
for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) {
@@ -1906,56 +1907,56 @@ class PPNode_Hash_Tree implements PPNode {
* @ingroup Parser
*/
class PPNode_Hash_Text implements PPNode {
- var $value, $nextSibling;
+ public $value, $nextSibling;
- function __construct( $value ) {
+ public function __construct( $value ) {
if ( is_object( $value ) ) {
throw new MWException( __CLASS__ . ' given object instead of string' );
}
$this->value = $value;
}
- function __toString() {
+ public function __toString() {
return htmlspecialchars( $this->value );
}
- function getNextSibling() {
+ public function getNextSibling() {
return $this->nextSibling;
}
- function getChildren() {
+ public function getChildren() {
return false;
}
- function getFirstChild() {
+ public function getFirstChild() {
return false;
}
- function getChildrenOfType( $name ) {
+ public function getChildrenOfType( $name ) {
return false;
}
- function getLength() {
+ public function getLength() {
return false;
}
- function item( $i ) {
+ public function item( $i ) {
return false;
}
- function getName() {
+ public function getName() {
return '#text';
}
- function splitArg() {
+ public function splitArg() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitExt() {
+ public function splitExt() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitHeading() {
+ public function splitHeading() {
throw new MWException( __METHOD__ . ': not supported' );
}
}
@@ -1964,53 +1965,53 @@ class PPNode_Hash_Text implements PPNode {
* @ingroup Parser
*/
class PPNode_Hash_Array implements PPNode {
- var $value, $nextSibling;
+ public $value, $nextSibling;
- function __construct( $value ) {
+ public function __construct( $value ) {
$this->value = $value;
}
- function __toString() {
+ public function __toString() {
return var_export( $this, true );
}
- function getLength() {
+ public function getLength() {
return count( $this->value );
}
- function item( $i ) {
+ public function item( $i ) {
return $this->value[$i];
}
- function getName() {
+ public function getName() {
return '#nodelist';
}
- function getNextSibling() {
+ public function getNextSibling() {
return $this->nextSibling;
}
- function getChildren() {
+ public function getChildren() {
return false;
}
- function getFirstChild() {
+ public function getFirstChild() {
return false;
}
- function getChildrenOfType( $name ) {
+ public function getChildrenOfType( $name ) {
return false;
}
- function splitArg() {
+ public function splitArg() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitExt() {
+ public function splitExt() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitHeading() {
+ public function splitHeading() {
throw new MWException( __METHOD__ . ': not supported' );
}
}
@@ -2019,54 +2020,54 @@ class PPNode_Hash_Array implements PPNode {
* @ingroup Parser
*/
class PPNode_Hash_Attr implements PPNode {
- var $name, $value, $nextSibling;
+ public $name, $value, $nextSibling;
- function __construct( $name, $value ) {
+ public function __construct( $name, $value ) {
$this->name = $name;
$this->value = $value;
}
- function __toString() {
+ public function __toString() {
return "<@{$this->name}>" . htmlspecialchars( $this->value ) . "</@{$this->name}>";
}
- function getName() {
+ public function getName() {
return $this->name;
}
- function getNextSibling() {
+ public function getNextSibling() {
return $this->nextSibling;
}
- function getChildren() {
+ public function getChildren() {
return false;
}
- function getFirstChild() {
+ public function getFirstChild() {
return false;
}
- function getChildrenOfType( $name ) {
+ public function getChildrenOfType( $name ) {
return false;
}
- function getLength() {
+ public function getLength() {
return false;
}
- function item( $i ) {
+ public function item( $i ) {
return false;
}
- function splitArg() {
+ public function splitArg() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitExt() {
+ public function splitExt() {
throw new MWException( __METHOD__ . ': not supported' );
}
- function splitHeading() {
+ public function splitHeading() {
throw new MWException( __METHOD__ . ': not supported' );
}
}
diff --git a/includes/parser/StripState.php b/includes/parser/StripState.php
index d4f4559bd7b0..5d1743e61c24 100644
--- a/includes/parser/StripState.php
+++ b/includes/parser/StripState.php
@@ -39,7 +39,7 @@ class StripState {
/**
* @param string $prefix
*/
- function __construct( $prefix ) {
+ public function __construct( $prefix ) {
$this->prefix = $prefix;
$this->data = array(
'nowiki' => array(),
@@ -54,7 +54,7 @@ class StripState {
* @param string $marker
* @param string $value
*/
- function addNoWiki( $marker, $value ) {
+ public function addNoWiki( $marker, $value ) {
$this->addItem( 'nowiki', $marker, $value );
}
@@ -62,7 +62,7 @@ class StripState {
* @param string $marker
* @param string $value
*/
- function addGeneral( $marker, $value ) {
+ public function addGeneral( $marker, $value ) {
$this->addItem( 'general', $marker, $value );
}
@@ -84,7 +84,7 @@ class StripState {
* @param string $text
* @return mixed
*/
- function unstripGeneral( $text ) {
+ public function unstripGeneral( $text ) {
return $this->unstripType( 'general', $text );
}
@@ -92,7 +92,7 @@ class StripState {
* @param string $text
* @return mixed
*/
- function unstripNoWiki( $text ) {
+ public function unstripNoWiki( $text ) {
return $this->unstripType( 'nowiki', $text );
}
@@ -100,7 +100,7 @@ class StripState {
* @param string $text
* @return mixed
*/
- function unstripBoth( $text ) {
+ public function unstripBoth( $text ) {
$text = $this->unstripType( 'general', $text );
$text = $this->unstripType( 'nowiki', $text );
return $text;
@@ -163,7 +163,7 @@ class StripState {
*
* @return StripState
*/
- function getSubState( $text ) {
+ public function getSubState( $text ) {
$subState = new StripState( $this->prefix );
$pos = 0;
while ( true ) {
@@ -199,7 +199,7 @@ class StripState {
* @param array $texts
* @return array
*/
- function merge( $otherState, $texts ) {
+ public function merge( $otherState, $texts ) {
$mergePrefix = Parser::getRandomString();
foreach ( $otherState->data as $type => $items ) {
@@ -229,7 +229,7 @@ class StripState {
* @param string $text Input string
* @return string
*/
- function killMarkers( $text ) {
+ public function killMarkers( $text ) {
return preg_replace( $this->regex, '', $text );
}
}