build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
[lhc/web/wiklou.git] / includes / parser / Preprocessor_DOM.php
index 7539307..79021dd 100644 (file)
@@ -24,9 +24,8 @@
 /**
  * @ingroup Parser
  */
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
 class Preprocessor_DOM extends Preprocessor {
-       // @codingStandardsIgnoreEnd
 
        /**
         * @var Parser
@@ -148,7 +147,6 @@ class Preprocessor_DOM extends Preprocessor {
         * @return PPNode_DOM
         */
        public function preprocessToObj( $text, $flags = 0 ) {
-
                $xml = $this->cacheGetTree( $text, $flags );
                if ( $xml === false ) {
                        $xml = $this->preprocessToXml( $text, $flags );
@@ -373,7 +371,6 @@ class Preprocessor_DOM extends Preprocessor {
                                }
                                // Handle comments
                                if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
-
                                        // To avoid leaving blank lines, when a sequence of
                                        // space-separated comments is both preceded and followed by
                                        // a newline (ignoring spaces), then
@@ -561,8 +558,16 @@ class Preprocessor_DOM extends Preprocessor {
                                                'count' => $count ];
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       $flags = $stack->getFlags();
-                                       extract( $flags );
+                                       $stackFlags = $stack->getFlags();
+                                       if ( isset( $stackFlags['findEquals'] ) ) {
+                                               $findEquals = $stackFlags['findEquals'];
+                                       }
+                                       if ( isset( $stackFlags['findPipe'] ) ) {
+                                               $findPipe = $stackFlags['findPipe'];
+                                       }
+                                       if ( isset( $stackFlags['inHeading'] ) ) {
+                                               $inHeading = $stackFlags['inHeading'];
+                                       }
                                        $i += $count;
                                }
                        } elseif ( $found == 'line-end' ) {
@@ -612,8 +617,16 @@ class Preprocessor_DOM extends Preprocessor {
                                // Unwind the stack
                                $stack->pop();
                                $accum =& $stack->getAccum();
-                               $flags = $stack->getFlags();
-                               extract( $flags );
+                               $stackFlags = $stack->getFlags();
+                               if ( isset( $stackFlags['findEquals'] ) ) {
+                                       $findEquals = $stackFlags['findEquals'];
+                               }
+                               if ( isset( $stackFlags['findPipe'] ) ) {
+                                       $findPipe = $stackFlags['findPipe'];
+                               }
+                               if ( isset( $stackFlags['inHeading'] ) ) {
+                                       $inHeading = $stackFlags['inHeading'];
+                               }
 
                                // Append the result to the enclosing accumulator
                                $accum .= $element;
@@ -627,7 +640,7 @@ class Preprocessor_DOM extends Preprocessor {
                                $curLen = strlen( $curChar );
                                $count = ( $curLen > 1 ) ?
                                        # allow the final character to repeat
-                                       strspn( $text, $curChar[$curLen-1], $i+1 ) + 1 :
+                                       strspn( $text, $curChar[$curLen - 1], $i + 1 ) + 1 :
                                        strspn( $text, $curChar, $i );
 
                                # we need to add to stack only if opening brace count is enough for one of the rules
@@ -642,8 +655,16 @@ class Preprocessor_DOM extends Preprocessor {
 
                                        $stack->push( $piece );
                                        $accum =& $stack->getAccum();
-                                       $flags = $stack->getFlags();
-                                       extract( $flags );
+                                       $stackFlags = $stack->getFlags();
+                                       if ( isset( $stackFlags['findEquals'] ) ) {
+                                               $findEquals = $stackFlags['findEquals'];
+                                       }
+                                       if ( isset( $stackFlags['findPipe'] ) ) {
+                                               $findPipe = $stackFlags['findPipe'];
+                                       }
+                                       if ( isset( $stackFlags['inHeading'] ) ) {
+                                               $inHeading = $stackFlags['inHeading'];
+                                       }
                                } else {
                                        # Add literal brace(s)
                                        $accum .= htmlspecialchars( str_repeat( $curChar, $count ) );
@@ -750,8 +771,16 @@ class Preprocessor_DOM extends Preprocessor {
                                                $accum .= $s;
                                        }
                                }
-                               $flags = $stack->getFlags();
-                               extract( $flags );
+                               $stackFlags = $stack->getFlags();
+                               if ( isset( $stackFlags['findEquals'] ) ) {
+                                       $findEquals = $stackFlags['findEquals'];
+                               }
+                               if ( isset( $stackFlags['findPipe'] ) ) {
+                                       $findPipe = $stackFlags['findPipe'];
+                               }
+                               if ( isset( $stackFlags['inHeading'] ) ) {
+                                       $inHeading = $stackFlags['inHeading'];
+                               }
 
                                # Add XML element to the enclosing accumulator
                                $accum .= $element;
@@ -994,9 +1023,8 @@ class PPDPart {
  * An expansion frame, used as a context to expand the result of preprocessToObj()
  * @ingroup Parser
  */
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
 class PPFrame_DOM implements PPFrame {
-       // @codingStandardsIgnoreEnd
 
        /**
         * @var Preprocessor
@@ -1612,9 +1640,8 @@ class PPFrame_DOM implements PPFrame {
  * Expansion frame with template arguments
  * @ingroup Parser
  */
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
 class PPTemplateFrame_DOM extends PPFrame_DOM {
-       // @codingStandardsIgnoreEnd
 
        public $numberedArgs, $namedArgs;
 
@@ -1791,9 +1818,8 @@ class PPTemplateFrame_DOM extends PPFrame_DOM {
  * Expansion frame with custom arguments
  * @ingroup Parser
  */
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
 class PPCustomFrame_DOM extends PPFrame_DOM {
-       // @codingStandardsIgnoreEnd
 
        public $args;
 
@@ -1844,9 +1870,8 @@ class PPCustomFrame_DOM extends PPFrame_DOM {
 /**
  * @ingroup Parser
  */
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
 class PPNode_DOM implements PPNode {
-       // @codingStandardsIgnoreEnd
 
        /**
         * @var DOMElement