Fix assortment of IDEA warnings
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 12 Feb 2017 02:12:42 +0000 (18:12 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 12 Feb 2017 02:12:42 +0000 (18:12 -0800)
Change-Id: I3fb482232483f37bf73ebbeb405056794109e618

includes/actions/InfoAction.php
includes/db/DatabaseOracle.php
includes/filerepo/file/ForeignDBFile.php
includes/widget/search/InterwikiSearchResultWidget.php

index 5fb83b3..167b709 100644 (file)
@@ -835,7 +835,7 @@ class InfoAction extends FormlessAction {
                $real_names = [];
                $user_names = [];
                $anon_ips = [];
-               $linkRenderer = MediaWikiServices::getLinkRenderer();
+               $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
                # Sift for real versus user names
                /** @var $user User */
index d8ed7a9..5dcb756 100644 (file)
@@ -1085,24 +1085,18 @@ class DatabaseOracle extends Database {
                }
        }
 
-       /**
-        * defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';
-        *
-        * @param resource $fp
-        * @param bool|string $lineCallback
-        * @param bool|callable $resultCallback
-        * @param string $fname
-        * @param bool|callable $inputCallback
-        * @return bool|string
-        */
-       function sourceStream( $fp, $lineCallback = false, $resultCallback = false,
-               $fname = __METHOD__, $inputCallback = false ) {
+       function sourceStream(
+               $fp,
+               callable $lineCallback = null,
+               callable $resultCallback = null,
+               $fname = __METHOD__, callable $inputCallback = null
+       ) {
                $cmd = '';
                $done = false;
                $dollarquote = false;
 
                $replacements = [];
-
+               // Defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';
                while ( !feof( $fp ) ) {
                        if ( $lineCallback ) {
                                call_user_func( $lineCallback );
index c6c49b4..f6f44e6 100644 (file)
@@ -120,10 +120,10 @@ class ForeignDBFile extends LocalFile {
        }
 
        /**
-        * @param bool|Language $lang Optional language to fetch description in.
+        * @param Language|null $lang Optional language to fetch description in.
         * @return string|false
         */
-       function getDescriptionText( $lang = false ) {
+       function getDescriptionText( $lang = null ) {
                global $wgLang;
 
                if ( !$this->repo->fetchDescription ) {
index 44229b8..6b51db5 100644 (file)
@@ -81,6 +81,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
                        default:
                                return "<div class='iw-result__title'>{$link} {$redirect}</div>" .
                                        "<div class='iw-result__content'>{$snippet}</div>";
-               };
+               }
        }
 }