X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FPreprocessor_Hash.php;h=c4c0c5ada410900b7008772944b9e2aa2efd5da6;hp=735c33a4fe74c44cdaaa32430e387f36fc1a52a7;hb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd;hpb=46fa949b8b5e10b1843d4ea2930679a0d3999025 diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 735c33a4fe..c4c0c5ada4 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -39,9 +39,8 @@ * * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class Preprocessor_Hash extends Preprocessor { - // @codingStandardsIgnoreEnd /** * @var Parser @@ -497,7 +496,16 @@ class Preprocessor_Hash extends Preprocessor { 'count' => $count ]; $stack->push( $piece ); $accum =& $stack->getAccum(); - extract( $stack->getFlags() ); + $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' ) { @@ -554,7 +562,16 @@ class Preprocessor_Hash extends Preprocessor { // Unwind the stack $stack->pop(); $accum =& $stack->getAccum(); - extract( $stack->getFlags() ); + $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 array_splice( $accum, count( $accum ), 0, $element ); @@ -584,7 +601,16 @@ class Preprocessor_Hash extends Preprocessor { $stack->push( $piece ); $accum =& $stack->getAccum(); - extract( $stack->getFlags() ); + $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) self::addLiteral( $accum, str_repeat( $curChar, $count ) ); @@ -695,7 +721,16 @@ class Preprocessor_Hash extends Preprocessor { } } - extract( $stack->getFlags() ); + $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 array_splice( $accum, count( $accum ), 0, $element ); @@ -753,12 +788,11 @@ class Preprocessor_Hash extends Preprocessor { * Stack class to help Preprocessor::preprocessToObj() * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPDStack_Hash extends PPDStack { - // @codingStandardsIgnoreEnd public function __construct() { - $this->elementClass = 'PPDStackElement_Hash'; + $this->elementClass = PPDStackElement_Hash::class; parent::__construct(); $this->rootAccum = []; } @@ -767,12 +801,11 @@ class PPDStack_Hash extends PPDStack { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPDStackElement_Hash extends PPDStackElement { - // @codingStandardsIgnoreEnd public function __construct( $data = [] ) { - $this->partClass = 'PPDPart_Hash'; + $this->partClass = PPDPart_Hash::class; parent::__construct( $data ); } @@ -821,9 +854,8 @@ class PPDStackElement_Hash extends PPDStackElement { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPDPart_Hash extends PPDPart { - // @codingStandardsIgnoreEnd public function __construct( $out = '' ) { if ( $out !== '' ) { @@ -839,9 +871,8 @@ class PPDPart_Hash extends 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_Hash implements PPFrame { - // @codingStandardsIgnoreEnd /** * @var Parser @@ -1439,9 +1470,8 @@ class PPFrame_Hash implements PPFrame { * Expansion frame with template arguments * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPTemplateFrame_Hash extends PPFrame_Hash { - // @codingStandardsIgnoreEnd public $numberedArgs, $namedArgs, $parent; public $numberedExpansionCache, $namedExpansionCache; @@ -1622,9 +1652,8 @@ class PPTemplateFrame_Hash extends PPFrame_Hash { * Expansion frame with custom arguments * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPCustomFrame_Hash extends PPFrame_Hash { - // @codingStandardsIgnoreEnd public $args; @@ -1675,9 +1704,8 @@ class PPCustomFrame_Hash extends PPFrame_Hash { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPNode_Hash_Tree implements PPNode { - // @codingStandardsIgnoreEnd public $name; @@ -1738,12 +1766,12 @@ class PPNode_Hash_Tree implements PPNode { $descriptor = $store[$index]; if ( is_string( $descriptor ) ) { - $class = 'PPNode_Hash_Text'; + $class = PPNode_Hash_Text::class; } elseif ( is_array( $descriptor ) ) { if ( $descriptor[self::NAME][0] === '@' ) { - $class = 'PPNode_Hash_Attr'; + $class = PPNode_Hash_Attr::class; } else { - $class = 'PPNode_Hash_Tree'; + $class = self::class; } } else { throw new MWException( __METHOD__.': invalid node descriptor' ); @@ -2023,9 +2051,8 @@ class PPNode_Hash_Tree implements PPNode { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPNode_Hash_Text implements PPNode { - // @codingStandardsIgnoreEnd public $value; private $store, $index; @@ -2094,9 +2121,8 @@ class PPNode_Hash_Text implements PPNode { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPNode_Hash_Array implements PPNode { - // @codingStandardsIgnoreEnd public $value; @@ -2152,9 +2178,8 @@ class PPNode_Hash_Array implements PPNode { /** * @ingroup Parser */ -// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps +// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps class PPNode_Hash_Attr implements PPNode { - // @codingStandardsIgnoreEnd public $name, $value; private $store, $index;