Merge "preprocessDump.php: Fix invalid Preprocessor instantiation"
[lhc/web/wiklou.git] / maintenance / preprocessDump.php
index b9e084e..05b78d4 100644 (file)
@@ -73,8 +73,9 @@ class PreprocessDump extends DumpIterator {
                        $name = Preprocessor_DOM::class;
                }
 
-               MediaWikiServices::getInstance()->getParser()->firstCallInit();
-               $this->mPreprocessor = new $name( $this );
+               $parser = MediaWikiServices::getInstance()->getParser();
+               $parser->firstCallInit();
+               $this->mPreprocessor = new $name( $parser );
        }
 
        /**
@@ -87,6 +88,8 @@ class PreprocessDump extends DumpIterator {
                if ( $content->getModel() !== CONTENT_MODEL_WIKITEXT ) {
                        return;
                }
+               /** @var WikitextContent $content */
+               '@phan-var WikitextContent $content';
 
                try {
                        $this->mPreprocessor->preprocessToObj( strval( $content->getText() ), 0 );