Fix PhanTypeMismatchDeclaredParam
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index b1ca435..1d9ad05 100644 (file)
@@ -102,7 +102,7 @@ class DifferenceEngine extends ContextSource {
        /**#@-*/
 
        /**
-        * @param IContextSource $context Context to use, anything else will be ignored
+        * @param IContextSource|null $context Context to use, anything else will be ignored
         * @param int $old Old ID we want to show and diff with.
         * @param string|int $new Either revision ID or 'prev' or 'next'. Default: 0.
         * @param int $rcid Deprecated, no longer used!
@@ -132,6 +132,8 @@ class DifferenceEngine extends ContextSource {
        }
 
        /**
+        * Get the language of the difference engine, defaults to page content language
+        *
         * @return Language
         */
        public function getDiffLang() {
@@ -312,7 +314,7 @@ class DifferenceEngine extends ContextSource {
                                        $rollbackLink = Linker::generateRollback( $this->mNewRev, $this->getContext() );
                                        if ( $rollbackLink ) {
                                                $out->preventClickjacking();
-                                               $rollback = '   ' . $rollbackLink;
+                                               $rollback = "\u{00A0}\u{00A0}\u{00A0}" . $rollbackLink;
                                        }
                                }
 
@@ -342,7 +344,7 @@ class DifferenceEngine extends ContextSource {
                                        [ 'diff' => 'prev', 'oldid' => $this->mOldid ] + $query
                                );
                        } else {
-                               $prevlink = ' ';
+                               $prevlink = "\u{00A0}";
                        }
 
                        if ( $this->mOldRev->isMinor() ) {
@@ -395,7 +397,7 @@ class DifferenceEngine extends ContextSource {
                                [ 'diff' => 'next', 'oldid' => $this->mNewid ] + $query
                        );
                } else {
-                       $nextlink = ' ';
+                       $nextlink = "\u{00A0}";
                }
 
                if ( $this->mNewRev->isMinor() ) {
@@ -586,7 +588,7 @@ class DifferenceEngine extends ContextSource {
        protected function revisionDeleteLink( $rev ) {
                $link = Linker::getRevDeleteLink( $this->getUser(), $rev, $rev->getTitle() );
                if ( $link !== '' ) {
-                       $link = '   ' . $link . ' ';
+                       $link = "\u{00A0}\u{00A0}\u{00A0}" . $link . ' ';
                }
 
                return $link;
@@ -756,10 +758,7 @@ class DifferenceEngine extends ContextSource {
                        // for backwards-compatibility
                        $key = $this->getDiffBodyCacheKey();
                        if ( $key === null ) {
-                               $key = call_user_func_array(
-                                       [ $cache, 'makeKey' ],
-                                       $this->getDiffBodyCacheKeyParams()
-                               );
+                               $key = $cache->makeKey( ...$this->getDiffBodyCacheKeyParams() );
                        }
 
                        // Try cache
@@ -1346,11 +1345,14 @@ class DifferenceEngine extends ContextSource {
 
        /**
         * Set the language in which the diff text is written
-        * (Defaults to page content language).
-        * @param Language|string $lang
+        *
+        * @param Language $lang
         * @since 1.19
         */
        public function setTextLanguage( $lang ) {
+               if ( !$lang instanceof Language ) {
+                       wfDeprecated( __METHOD__ . ' with other type than Language for $lang', '1.32' );
+               }
                $this->mDiffLang = wfGetLangObj( $lang );
        }