Merge "Clarifies the meaning of the function which tests the bug T34712"
[lhc/web/wiklou.git] / includes / parser / Preprocessor_Hash.php
index d7f5953..b4b14dc 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
@@ -759,8 +761,11 @@ class Preprocessor_Hash implements Preprocessor {
 /**
  * Stack class to help Preprocessor::preprocessToObj()
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDStack_Hash extends PPDStack {
+       // @codingStandardsIgnoreEnd
+
        public function __construct() {
                $this->elementClass = 'PPDStackElement_Hash';
                parent::__construct();
@@ -770,8 +775,11 @@ class PPDStack_Hash extends PPDStack {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDStackElement_Hash extends PPDStackElement {
+       // @codingStandardsIgnoreENd
+
        public function __construct( $data = array() ) {
                $this->partClass = 'PPDPart_Hash';
                parent::__construct( $data );
@@ -808,8 +816,11 @@ class PPDStackElement_Hash extends PPDStackElement {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDPart_Hash extends PPDPart {
+       // @codingStandardsIgnoreEnd
+
        public function __construct( $out = '' ) {
                $accum = new PPDAccum_Hash;
                if ( $out !== '' ) {
@@ -821,8 +832,11 @@ class PPDPart_Hash extends PPDPart {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPDAccum_Hash {
+       // @codingStandardsIgnoreEnd
+
        public $firstNode, $lastNode;
 
        public function __construct() {
@@ -889,8 +903,10 @@ 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
@@ -969,11 +985,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] );
                                }
@@ -985,7 +1007,7 @@ 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
         */
@@ -1208,6 +1230,7 @@ class PPFrame_Hash implements PPFrame {
        /**
         * @param string $sep
         * @param int $flags
+        * @param string|PPNode $args,...
         * @return string
         */
        public function implodeWithFlags( $sep, $flags /*, ... */ ) {
@@ -1238,6 +1261,7 @@ 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
         */
        public function implode( $sep /*, ... */ ) {
@@ -1269,6 +1293,7 @@ class PPFrame_Hash implements PPFrame {
         * with implode()
         *
         * @param string $sep
+        * @param string|PPNode $args,...
         * @return PPNode_Hash_Array
         */
        public function virtualImplode( $sep /*, ... */ ) {
@@ -1301,6 +1326,7 @@ class PPFrame_Hash implements PPFrame {
         * @param string $start
         * @param string $sep
         * @param string $end
+        * @param string|PPNode $args,...
         * @return PPNode_Hash_Array
         */
        public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
@@ -1453,8 +1479,11 @@ class PPFrame_Hash implements PPFrame {
 /**
  * Expansion frame with template arguments
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPTemplateFrame_Hash extends PPFrame_Hash {
+       // @codingStandardsIgnoreEnd
+
        public $numberedArgs, $namedArgs, $parent;
        public $numberedExpansionCache, $namedExpansionCache;
 
@@ -1505,7 +1534,7 @@ 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
         */
@@ -1633,8 +1662,11 @@ class PPTemplateFrame_Hash extends PPFrame_Hash {
 /**
  * Expansion frame with custom arguments
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPCustomFrame_Hash extends PPFrame_Hash {
+       // @codingStandardsIgnoreEnd
+
        public $args;
 
        public function __construct( $preprocessor, $args ) {
@@ -1683,8 +1715,11 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Tree implements PPNode {
+       // @codingStandardsIgnoreEnd
+
        public $name, $firstChild, $lastChild, $nextSibling;
 
        public function __construct( $name ) {
@@ -1905,8 +1940,11 @@ class PPNode_Hash_Tree implements PPNode {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Text implements PPNode {
+       // @codingStandardsIgnoreEnd
+
        public $value, $nextSibling;
 
        public function __construct( $value ) {
@@ -1963,8 +2001,11 @@ class PPNode_Hash_Text implements PPNode {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Array implements PPNode {
+       // @codingStandardsIgnoreEnd
+
        public $value, $nextSibling;
 
        public function __construct( $value ) {
@@ -2018,8 +2059,11 @@ class PPNode_Hash_Array implements PPNode {
 
 /**
  * @ingroup Parser
+ * @codingStandardsIgnoreStart
  */
 class PPNode_Hash_Attr implements PPNode {
+       // @codingStandardsIgnoreEnd
+
        public $name, $value, $nextSibling;
 
        public function __construct( $name, $value ) {