Merge "Correct autonym for rmy (Vlax Romani)"
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index 87863a4..1ab1246 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
@@ -1730,16 +1733,16 @@ class DifferenceEngine extends ContextSource {
         * by the request context); if oldid is 0, then compare the revision in newid to the
         * immediately previous one.
         *
-        * If oldid is false, leave the corresponding revision object set
-        * to false. This can happen with 'diff=prev' pointing to a non-existent revision,
-        * and is also used directly by the API.
+        * If oldid is false, leave the corresponding revision object set to false. This can
+        * happen with 'diff=prev' pointing to a non-existent revision, and is also used directly
+        * by the API.
         *
         * @return bool Whether both revisions were loaded successfully. Setting mOldRev
         *   to false counts as successful loading.
         */
        public function loadRevisionData() {
                if ( $this->mRevisionsLoaded ) {
-                       return $this->isContentOverridden || $this->mNewRev && !is_null( $this->mOldRev );
+                       return $this->isContentOverridden || ( $this->mOldRev !== null && $this->mNewRev !== null );
                }
 
                // Whether it succeeds or fails, we don't want to try again