Fix order of @var parameter in PHP
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index 43bc6e4..833bc69 100644 (file)
@@ -250,7 +250,7 @@ class DifferenceEngine extends ContextSource {
 
                        $slotContents = $this->getSlotContents();
                        $this->slotDiffRenderers = array_map( function ( $contents ) {
-                               /** @var $content Content */
+                               /** @var Content $content */
                                $content = $contents['new'] ?: $contents['old'];
                                return $content->getContentHandler()->getSlotDiffRenderer( $this->getContext() );
                        }, $slotContents );
@@ -956,7 +956,10 @@ class DifferenceEngine extends ContextSource {
         */
        public function showDiffStyle() {
                if ( !$this->isSlotDiffRenderer ) {
-                       $this->getOutput()->addModuleStyles( 'mediawiki.diff.styles' );
+                       $this->getOutput()->addModuleStyles( [
+                               'mediawiki.interface.helpers.styles',
+                               'mediawiki.diff.styles'
+                       ] );
                        foreach ( $this->getSlotDiffRenderers() as $slotDiffRenderer ) {
                                $slotDiffRenderer->addModules( $this->getOutput() );
                        }
@@ -1021,7 +1024,7 @@ class DifferenceEngine extends ContextSource {
 
                // Cacheable?
                $key = false;
-               $cache = ObjectCache::getMainWANInstance();
+               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                if ( $this->mOldid && $this->mNewid ) {
                        // Check if subclass is still using the old way
                        // for backwards-compatibility
@@ -1033,7 +1036,7 @@ class DifferenceEngine extends ContextSource {
                        // Try cache
                        if ( !$this->mRefreshCache ) {
                                $difftext = $cache->get( $key );
-                               if ( $difftext ) {
+                               if ( is_string( $difftext ) ) {
                                        wfIncrStats( 'diff_cache.hit' );
                                        $difftext = $this->localiseDiff( $difftext );
                                        $difftext .= "\n<!-- diff cache key $key -->\n";