Merge "ActiveUsersPager: Fix ordering and return 0-action users"
[lhc/web/wiklou.git] / includes / parser / ParserOutput.php
index 48ba111..e0e5d75 100644 (file)
@@ -120,11 +120,6 @@ class ParserOutput extends CacheTime {
         */
        public $mModules = [];
 
-       /**
-        * @var array $mModuleScripts Modules of which only the JS will be loaded by ResourceLoader.
-        */
-       public $mModuleScripts = [];
-
        /**
         * @var array $mModuleStyles Modules of which only the CSSS will be loaded by ResourceLoader.
         */
@@ -325,7 +320,6 @@ class ParserOutput extends CacheTime {
                        $text = preg_replace_callback(
                                self::EDITSECTION_REGEX,
                                function ( $m ) {
-                                       global $wgOut, $wgLang;
                                        $editsectionPage = Title::newFromText( htmlspecialchars_decode( $m[1] ) );
                                        $editsectionSection = htmlspecialchars_decode( $m[2] );
                                        $editsectionContent = isset( $m[4] ) ? Sanitizer::decodeCharReferences( $m[3] ) : null;
@@ -334,11 +328,12 @@ class ParserOutput extends CacheTime {
                                                throw new MWException( "Bad parser output text." );
                                        }
 
-                                       $skin = $wgOut->getSkin();
-                                       return $skin->doEditSectionLink( $editsectionPage,
+                                       $context = RequestContext::getMain();
+                                       return $context->getSkin()->doEditSectionLink(
+                                               $editsectionPage,
                                                $editsectionSection,
                                                $editsectionContent,
-                                               $wgLang->getCode()
+                                               $context->getLanguage()
                                        );
                                },
                                $text
@@ -524,7 +519,8 @@ class ParserOutput extends CacheTime {
        }
 
        public function getModuleScripts() {
-               return $this->mModuleScripts;
+               wfDeprecated( __METHOD__, '1.33' );
+               return [];
        }
 
        public function getModuleStyles() {
@@ -817,14 +813,6 @@ class ParserOutput extends CacheTime {
                $this->mModules = array_merge( $this->mModules, (array)$modules );
        }
 
-       /**
-        * @deprecated since 1.31 Use addModules() instead.
-        * @see OutputPage::addModuleScripts
-        */
-       public function addModuleScripts( $modules ) {
-               $this->mModuleScripts = array_merge( $this->mModuleScripts, (array)$modules );
-       }
-
        /**
         * @see OutputPage::addModuleStyles
         */
@@ -857,7 +845,6 @@ class ParserOutput extends CacheTime {
         */
        public function addOutputPageMetadata( OutputPage $out ) {
                $this->addModules( $out->getModules() );
-               $this->addModuleScripts( $out->getModuleScripts() );
                $this->addModuleStyles( $out->getModuleStyles() );
                $this->addJsConfigVars( $out->getJsConfigVars() );
 
@@ -1127,11 +1114,7 @@ class ParserOutput extends CacheTime {
         *         or null if no value was set for this key.
         */
        public function getExtensionData( $key ) {
-               if ( isset( $this->mExtensionData[$key] ) ) {
-                       return $this->mExtensionData[$key];
-               }
-
-               return null;
+               return $this->mExtensionData[$key] ?? null;
        }
 
        private static function getTimes( $clock = null ) {
@@ -1342,7 +1325,6 @@ class ParserOutput extends CacheTime {
                // HTML and HTTP
                $this->mHeadItems = self::mergeMixedList( $this->mHeadItems, $source->getHeadItems() );
                $this->mModules = self::mergeList( $this->mModules, $source->getModules() );
-               $this->mModuleScripts = self::mergeList( $this->mModuleScripts, $source->getModuleScripts() );
                $this->mModuleStyles = self::mergeList( $this->mModuleStyles, $source->getModuleStyles() );
                $this->mJsConfigVars = self::mergeMap( $this->mJsConfigVars, $source->getJsConfigVars() );
                $this->mMaxAdaptiveExpiry = min( $this->mMaxAdaptiveExpiry, $source->mMaxAdaptiveExpiry );