Merge "[MCR] Introduce SlotRoleHandler and SlotRoleRegistry"
[lhc/web/wiklou.git] / includes / content / WikitextContentHandler.php
index 74b2f1a..ab157f5 100644 (file)
@@ -23,6 +23,8 @@
  * @ingroup Content
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Content handler for wiki text pages.
  *
@@ -60,7 +62,7 @@ class WikitextContentHandler extends TextContentHandler {
                        }
                }
 
-               $mwRedir = MagicWord::get( 'redirect' );
+               $mwRedir = MediaWikiServices::getInstance()->getMagicWordFactory()->get( 'redirect' );
                $redirectText = $mwRedir->getSynonym( 0 ) .
                        ' [[' . $optionalColon . $destination->getFullText() . ']]';
 
@@ -128,16 +130,20 @@ class WikitextContentHandler extends TextContentHandler {
 
                $fields['opening_text'] =
                        $engine->makeSearchFieldMapping( 'opening_text', SearchIndexField::INDEX_TYPE_TEXT );
-               $fields['opening_text']->setFlag( SearchIndexField::FLAG_SCORING |
-                                                 SearchIndexField::FLAG_NO_HIGHLIGHT );
+               $fields['opening_text']->setFlag(
+                       SearchIndexField::FLAG_SCORING | SearchIndexField::FLAG_NO_HIGHLIGHT
+               );
                // Until we have full first-class content handler for files, we invoke it explicitly here
                $fields = array_merge( $fields, $this->getFileHandler()->getFieldsForSearchIndex( $engine ) );
 
                return $fields;
        }
 
-       public function getDataForSearchIndex( WikiPage $page, ParserOutput $parserOutput,
-                                              SearchEngine $engine ) {
+       public function getDataForSearchIndex(
+               WikiPage $page,
+               ParserOutput $parserOutput,
+               SearchEngine $engine
+       ) {
                $fields = parent::getDataForSearchIndex( $page, $parserOutput, $engine );
 
                $structure = new WikiTextStructure( $parserOutput );