X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpreprocessDump.php;h=ec759dae334dec4d1523882c42f63a0d7bdf1da5;hb=2f115a877f99c8ec5b4cb5f237a48097db933047;hp=b9e084eab11fc56381fdeac9deb4b66e346b1cdf;hpb=4549aabaec52cdb870fed9f8e735901199ac4832;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/preprocessDump.php b/maintenance/preprocessDump.php index b9e084eab1..ec759dae33 100644 --- a/maintenance/preprocessDump.php +++ b/maintenance/preprocessDump.php @@ -26,7 +26,7 @@ */ use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Revision\RevisionRecord; require_once __DIR__ . '/dumpIterator.php'; @@ -41,6 +41,8 @@ class PreprocessDump extends DumpIterator { /* Variables for dressing up as a parser */ public $mTitle = 'PreprocessDump'; public $mPPNodeCount = 0; + /** @var Preprocessor */ + public $mPreprocessor; public function getStripList() { $parser = MediaWikiServices::getInstance()->getParser(); @@ -73,8 +75,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 +90,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 );