public $mImageParams = [];
public $mImageParamsMagicArray = [];
public $mMarkerIndex = 0;
+ /**
+ * @var bool Whether firstCallInit still needs to be called
+ */
public $mFirstCall = true;
# Initialised by initialiseVariables()
* @private
*/
public function clearState() {
- if ( $this->mFirstCall ) {
- $this->firstCallInit();
- }
+ $this->firstCallInit();
$this->mOutput = new ParserOutput;
$this->mOptions->registerWatcher( [ $this->mOutput, 'recordOption' ] );
$this->mAutonumber = 0;
return $this->mLinkRenderer;
}
+ /**
+ * Get the MagicWordFactory that this Parser is using
+ *
+ * @since 1.32
+ * @return MagicWordFactory
+ */
+ public function getMagicWordFactory() {
+ return $this->magicWordFactory;
+ }
+
/**
* Replaces all occurrences of HTML-style comments and the given tags
* in the text with a random marker and returns the next text. The output
$variableIDs = $this->magicWordFactory->getVariableIDs();
$substIDs = $this->magicWordFactory->getSubstIDs();
- $this->mVariables = new MagicWordArray( $variableIDs );
- $this->mSubstWords = new MagicWordArray( $substIDs );
+ $this->mVariables = $this->magicWordFactory->newArray( $variableIDs );
+ $this->mSubstWords = $this->magicWordFactory->newArray( $substIDs );
}
/**
unset( $paramMap['img_width'] );
}
- $mwArray = new MagicWordArray( array_keys( $paramMap ) );
+ $mwArray = $this->magicWordFactory->newArray( array_keys( $paramMap ) );
$label = '';
$alt = '';
}
}
$this->mImageParams[$handlerClass] = $paramMap;
- $this->mImageParamsMagicArray[$handlerClass] = new MagicWordArray( array_keys( $paramMap ) );
+ $this->mImageParamsMagicArray[$handlerClass] =
+ $this->magicWordFactory->newArray( array_keys( $paramMap ) );
}
return [ $this->mImageParams[$handlerClass], $this->mImageParamsMagicArray[$handlerClass] ];
}