*
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class Preprocessor_Hash extends Preprocessor {
- // @codingStandardsIgnoreEnd
/**
* @var Parser
'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' ) {
// 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 );
$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 ) );
}
}
- 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 );
* 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 = [];
}
/**
* @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 );
}
/**
* @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 !== '' ) {
* 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
* 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;
* 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;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Tree implements PPNode {
- // @codingStandardsIgnoreEnd
public $name;
$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' );
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'] ) ) {
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'] ) ) {
/**
* @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;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Array implements PPNode {
- // @codingStandardsIgnoreEnd
public $value;
/**
* @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;