X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FPreprocessor_DOM.php;h=79021dda23879a4e39cac903cd1afd00673c7d5b;hb=255d76f2a13a8378ded9f0cf1c2bb172f7f07a5b;hp=3c750ad7dc3717b773ce64c4d47417f96a7618dd;hpb=925fe0df015458a330d320c9f1a0014d32ff8866;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 3c750ad7dc..79021dda23 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -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 @@ -559,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' ) { @@ -610,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; @@ -625,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 @@ -640,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 ) ); @@ -748,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; @@ -992,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 @@ -1610,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; @@ -1789,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; @@ -1842,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