X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FPreprocessor_Hash.php;h=8e84cb2c823617c625071ccef7cb42f71c883e6f;hb=5d743b03814d2e36abc45f0d9e048d6390b01084;hp=9ea8fa3a5098facbd437c8d39abc26f3f61a0e1c;hpb=c05926bc7ce57cbea42e90053ef799fa58b9da1e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 9ea8fa3a50..145fbbc592 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -497,7 +497,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 +563,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 +602,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 +722,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 ); @@ -1715,7 +1751,7 @@ class PPNode_Hash_Tree implements PPNode { * store array can be accessed via getNextSibling(). * * @param array $store - * @param integer $index + * @param int $index */ public function __construct( array $store, $index ) { $this->store = $store; @@ -1728,7 +1764,7 @@ class PPNode_Hash_Tree implements PPNode { * on what is at the relevant store index. * * @param array $store - * @param integer $index + * @param int $index * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text */ public static function factory( array $store, $index ) { @@ -1787,7 +1823,7 @@ class PPNode_Hash_Tree implements PPNode { * return a temporary proxy object: different instances will be returned * if this is called more than once on the same node. * - * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean + * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool */ public function getFirstChild() { if ( !isset( $this->rawChildren[0] ) ) { @@ -1802,7 +1838,7 @@ class PPNode_Hash_Tree implements PPNode { * return a temporary proxy object: different instances will be returned * if this is called more than once on the same node. * - * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean + * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool */ public function getNextSibling() { return self::factory( $this->store, $this->index + 1 ); @@ -1869,6 +1905,8 @@ class PPNode_Hash_Tree implements PPNode { /** * Like splitArg() but for a raw child array. For internal use only. + * @param array $children + * @return array */ public static function splitRawArg( array $children ) { $bits = []; @@ -1910,6 +1948,8 @@ class PPNode_Hash_Tree implements PPNode { /** * Like splitExt() but for a raw child array. For internal use only. + * @param array $children + * @return array */ public static function splitRawExt( array $children ) { $bits = []; @@ -1918,18 +1958,18 @@ class PPNode_Hash_Tree implements PPNode { continue; } switch ( $child[self::NAME] ) { - case 'name': - $bits['name'] = new self( $children, $i ); - break; - case 'attr': - $bits['attr'] = new self( $children, $i ); - break; - case 'inner': - $bits['inner'] = new self( $children, $i ); - break; - case 'close': - $bits['close'] = new self( $children, $i ); - break; + case 'name': + $bits['name'] = new self( $children, $i ); + break; + case 'attr': + $bits['attr'] = new self( $children, $i ); + break; + case 'inner': + $bits['inner'] = new self( $children, $i ); + break; + case 'close': + $bits['close'] = new self( $children, $i ); + break; } } if ( !isset( $bits['name'] ) ) { @@ -1953,6 +1993,8 @@ class PPNode_Hash_Tree implements PPNode { /** * Like splitHeading() but for a raw child array. For internal use only. + * @param array $children + * @return array */ public static function splitRawHeading( array $children ) { $bits = []; @@ -1984,6 +2026,8 @@ class PPNode_Hash_Tree implements PPNode { /** * Like splitTemplate() but for a raw child array. For internal use only. + * @param array $children + * @return array */ public static function splitRawTemplate( array $children ) { $parts = []; @@ -1993,15 +2037,15 @@ class PPNode_Hash_Tree implements PPNode { continue; } switch ( $child[self::NAME] ) { - case 'title': - $bits['title'] = new self( $children, $i ); - break; - case 'part': - $parts[] = new self( $children, $i ); - break; - case '@lineStart': - $bits['lineStart'] = '1'; - break; + case 'title': + $bits['title'] = new self( $children, $i ); + break; + case 'part': + $parts[] = new self( $children, $i ); + break; + case '@lineStart': + $bits['lineStart'] = '1'; + break; } } if ( !isset( $bits['title'] ) ) { @@ -2027,7 +2071,7 @@ class PPNode_Hash_Text implements PPNode { * store array can be accessed via getNextSibling(). * * @param array $store - * @param integer $index + * @param int $index */ public function __construct( array $store, $index ) { $this->value = $store[$index]; @@ -2156,7 +2200,7 @@ class PPNode_Hash_Attr implements PPNode { * store array can be accessed via getNextSibling(). * * @param array $store - * @param integer $index + * @param int $index */ public function __construct( array $store, $index ) { $descriptor = $store[$index];