Removed remaining profile calls
[lhc/web/wiklou.git] / includes / parser / Preprocessor_Hash.php
index 26daca1..af91ad4 100644 (file)
  *   * attribute nodes are children
  *   * "<h>" nodes that aren't at the top are replaced with <possible-h>
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class Preprocessor_Hash implements Preprocessor {
+       // @codingStandardsIgnoreEnd
+
        /**
         * @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 +53,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 +61,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,8 +111,7 @@ class Preprocessor_Hash implements Preprocessor {
         * @throws MWException
         * @return PPNode_Hash_Tree
         */
-       function preprocessToObj( $text, $flags = 0 ) {
-               wfProfileIn( __METHOD__ );
+       public function preprocessToObj( $text, $flags = 0 ) {
 
                // Check cache.
                global $wgMemc, $wgPreprocessorCacheThreshold;
@@ -118,7 +120,6 @@ class Preprocessor_Hash implements Preprocessor {
                        && strlen( $text ) > $wgPreprocessorCacheThreshold;
 
                if ( $cacheable ) {
-                       wfProfileIn( __METHOD__ . '-cacheable' );
 
                        $cacheKey = wfMemcKey( 'preprocess-hash', md5( $text ), $flags );
                        $cacheValue = $wgMemc->get( $cacheKey );
@@ -129,12 +130,9 @@ class Preprocessor_Hash implements Preprocessor {
                                        // From the cache
                                        wfDebugLog( "Preprocessor",
                                                "Loaded preprocessor hash from memcached (key $cacheKey)" );
-                                       wfProfileOut( __METHOD__ . '-cacheable' );
-                                       wfProfileOut( __METHOD__ );
                                        return $hash;
                                }
                        }
-                       wfProfileIn( __METHOD__ . '-cache-miss' );
                }
 
                $rules = array(
@@ -634,18 +632,12 @@ class Preprocessor_Hash implements Preprocessor {
                                                        }
                                                        if ( !$node ) {
                                                                if ( $cacheable ) {
-                                                                       wfProfileOut( __METHOD__ . '-cache-miss' );
-                                                                       wfProfileOut( __METHOD__ . '-cacheable' );
                                                                }
-                                                               wfProfileOut( __METHOD__ );
                                                                throw new MWException( __METHOD__ . ': eqpos not found' );
                                                        }
                                                        if ( $node->name !== 'equals' ) {
                                                                if ( $cacheable ) {
-                                                                       wfProfileOut( __METHOD__ . '-cache-miss' );
-                                                                       wfProfileOut( __METHOD__ . '-cacheable' );
                                                                }
-                                                               wfProfileOut( __METHOD__ );
                                                                throw new MWException( __METHOD__ . ': eqpos is not equals' );
                                                        }
                                                        $equalsNode = $node;
@@ -745,12 +737,9 @@ class Preprocessor_Hash implements Preprocessor {
                if ( $cacheable ) {
                        $cacheValue = sprintf( "%08d", self::CACHE_VERSION ) . serialize( $rootNode );
                        $wgMemc->set( $cacheKey, $cacheValue, 86400 );
-                       wfProfileOut( __METHOD__ . '-cache-miss' );
-                       wfProfileOut( __METHOD__ . '-cacheable' );
                        wfDebugLog( "Preprocessor", "Saved preprocessor Hash to memcached (key $cacheKey)" );
                }
 
-               wfProfileOut( __METHOD__ );
                return $rootNode;
        }
 }
@@ -758,9 +747,12 @@ class Preprocessor_Hash implements Preprocessor {
 /**
  * Stack class to help Preprocessor::preprocessToObj()
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDStack_Hash extends PPDStack {
-       function __construct() {
+       // @codingStandardsIgnoreEnd
+
+       public function __construct() {
                $this->elementClass = 'PPDStackElement_Hash';
                parent::__construct();
                $this->rootAccum = new PPDAccum_Hash;
@@ -769,9 +761,12 @@ class PPDStack_Hash extends PPDStack {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDStackElement_Hash extends PPDStackElement {
-       function __construct( $data = array() ) {
+       // @codingStandardsIgnoreENd
+
+       public function __construct( $data = array() ) {
                $this->partClass = 'PPDPart_Hash';
                parent::__construct( $data );
        }
@@ -782,7 +777,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 {
@@ -807,9 +802,12 @@ class PPDStackElement_Hash extends PPDStackElement {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDPart_Hash extends PPDPart {
-       function __construct( $out = '' ) {
+       // @codingStandardsIgnoreEnd
+
+       public function __construct( $out = '' ) {
                $accum = new PPDAccum_Hash;
                if ( $out !== '' ) {
                        $accum->addLiteral( $out );
@@ -820,11 +818,14 @@ class PPDPart_Hash extends PPDPart {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDAccum_Hash {
-       var $firstNode, $lastNode;
+       // @codingStandardsIgnoreEnd
 
-       function __construct() {
+       public $firstNode, $lastNode;
+
+       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 ) {
@@ -888,36 +889,38 @@ class PPDAccum_Hash {
 /**
  * An expansion frame, used as a context to expand the result of preprocessToObj()
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPFrame_Hash implements PPFrame {
+       // @codingStandardsIgnoreEnd
 
        /**
         * @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 +934,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 +954,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 ) {
@@ -968,11 +971,17 @@ class PPFrame_Hash implements PPFrame {
                                if ( $bits['index'] !== '' ) {
                                        // Numbered parameter
                                        $index = $bits['index'] - $indexOffset;
+                                       if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $numberedArgs[$index] = $bits['value'];
                                        unset( $namedArgs[$index] );
                                } else {
                                        // Named parameter
                                        $name = trim( $this->expand( $bits['name'], PPFrame::STRIP_COMMENTS ) );
+                                       if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $namedArgs[$name] = $bits['value'];
                                        unset( $numberedArgs[$name] );
                                }
@@ -984,11 +993,11 @@ class PPFrame_Hash implements PPFrame {
        /**
         * @throws MWException
         * @param string|int $key
-        * @param string|PPNode_Hash|DOMDocument $root
+        * @param string|PPNode $root
         * @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 +1008,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;
@@ -1207,9 +1216,10 @@ class PPFrame_Hash implements PPFrame {
        /**
         * @param string $sep
         * @param int $flags
+        * @param string|PPNode $args,...
         * @return string
         */
-       function implodeWithFlags( $sep, $flags /*, ... */ ) {
+       public function implodeWithFlags( $sep, $flags /*, ... */ ) {
                $args = array_slice( func_get_args(), 2 );
 
                $first = true;
@@ -1237,9 +1247,10 @@ class PPFrame_Hash implements PPFrame {
         * Implode with no flags specified
         * This previously called implodeWithFlags but has now been inlined to reduce stack depth
         * @param string $sep
+        * @param string|PPNode $args,...
         * @return string
         */
-       function implode( $sep /*, ... */ ) {
+       public function implode( $sep /*, ... */ ) {
                $args = array_slice( func_get_args(), 1 );
 
                $first = true;
@@ -1268,9 +1279,10 @@ class PPFrame_Hash implements PPFrame {
         * with implode()
         *
         * @param string $sep
+        * @param string|PPNode $args,...
         * @return PPNode_Hash_Array
         */
-       function virtualImplode( $sep /*, ... */ ) {
+       public function virtualImplode( $sep /*, ... */ ) {
                $args = array_slice( func_get_args(), 1 );
                $out = array();
                $first = true;
@@ -1300,9 +1312,10 @@ class PPFrame_Hash implements PPFrame {
         * @param string $start
         * @param string $sep
         * @param string $end
+        * @param string|PPNode $args,...
         * @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 +1340,7 @@ class PPFrame_Hash implements PPFrame {
                return new PPNode_Hash_Array( $out );
        }
 
-       function __toString() {
+       public function __toString() {
                return 'frame{}';
        }
 
@@ -1335,7 +1348,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 +1359,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 +1382,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return bool
         */
-       function isEmpty() {
+       public function isEmpty() {
                return true;
        }
 
@@ -1377,7 +1390,7 @@ class PPFrame_Hash implements PPFrame {
         * @param string $name
         * @return bool
         */
-       function getArgument( $name ) {
+       public function getArgument( $name ) {
                return false;
        }
 
@@ -1388,7 +1401,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return bool
         */
-       function loopCheck( $title ) {
+       public function loopCheck( $title ) {
                return !isset( $this->loopCheckHash[$title->getPrefixedDBkey()] );
        }
 
@@ -1397,7 +1410,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return bool
         */
-       function isTemplate() {
+       public function isTemplate() {
                return false;
        }
 
@@ -1406,7 +1419,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return Title
         */
-       function getTitle() {
+       public function getTitle() {
                return $this->title;
        }
 
@@ -1415,7 +1428,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @param bool $flag
         */
-       function setVolatile( $flag = true ) {
+       public function setVolatile( $flag = true ) {
                $this->volatile = $flag;
        }
 
@@ -1424,7 +1437,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return bool
         */
-       function isVolatile() {
+       public function isVolatile() {
                return $this->volatile;
        }
 
@@ -1433,7 +1446,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 +1457,7 @@ class PPFrame_Hash implements PPFrame {
         *
         * @return int|null
         */
-       function getTTL() {
+       public function getTTL() {
                return $this->ttl;
        }
 }
@@ -1452,10 +1465,13 @@ class PPFrame_Hash implements PPFrame {
 /**
  * Expansion frame with template arguments
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPTemplateFrame_Hash extends PPFrame_Hash {
-       var $numberedArgs, $namedArgs, $parent;
-       var $numberedExpansionCache, $namedExpansionCache;
+       // @codingStandardsIgnoreEnd
+
+       public $numberedArgs, $namedArgs, $parent;
+       public $numberedExpansionCache, $namedExpansionCache;
 
        /**
         * @param Preprocessor $preprocessor
@@ -1464,7 +1480,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 +1500,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;
@@ -1504,11 +1520,11 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
        /**
         * @throws MWException
         * @param string|int $key
-        * @param string|PPNode_Hash|DOMDocument $root
+        * @param string|PPNode $root
         * @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 +1540,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 +1560,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 +1571,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 +1583,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 +1601,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 +1617,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 +1630,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 );
        }
@@ -1632,16 +1648,19 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
 /**
  * Expansion frame with custom arguments
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPCustomFrame_Hash extends PPFrame_Hash {
-       var $args;
+       // @codingStandardsIgnoreEnd
 
-       function __construct( $preprocessor, $args ) {
+       public $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 +1679,7 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
        /**
         * @return bool
         */
-       function isEmpty() {
+       public function isEmpty() {
                return !count( $this->args );
        }
 
@@ -1668,30 +1687,33 @@ 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;
        }
 }
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Tree implements PPNode {
-       var $name, $firstChild, $lastChild, $nextSibling;
+       // @codingStandardsIgnoreEnd
+
+       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 +1735,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 +1753,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 +1761,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 +1782,7 @@ class PPNode_Hash_Tree implements PPNode {
        /**
         * @return bool
         */
-       function getLength() {
+       public function getLength() {
                return false;
        }
 
@@ -1768,14 +1790,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 +1810,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 +1844,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 +1872,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 +1899,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 ) {
@@ -1904,169 +1926,178 @@ class PPNode_Hash_Tree implements PPNode {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Text implements PPNode {
-       var $value, $nextSibling;
+       // @codingStandardsIgnoreEnd
 
-       function __construct( $value ) {
+       public $value, $nextSibling;
+
+       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' );
        }
 }
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Array implements PPNode {
-       var $value, $nextSibling;
+       // @codingStandardsIgnoreEnd
+
+       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' );
        }
 }
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Attr implements PPNode {
-       var $name, $value, $nextSibling;
+       // @codingStandardsIgnoreEnd
+
+       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' );
        }
 }