From: Max Semenik Date: Thu, 15 Dec 2016 23:19:57 +0000 (-0800) Subject: Decrease the number of 'function says it should return something' errors X-Git-Tag: 1.31.0-rc.0~4551^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=d4f3e554d789d1c100d0e2eac97372fb83ef5e47;p=lhc%2Fweb%2Fwiklou.git Decrease the number of 'function says it should return something' errors Change-Id: Ib5115fe5bbaa67d8a6e54cc3ba1ba7020e239e11 --- diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index 2a6c938a47..9a0d3ffd4c 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -90,7 +90,6 @@ class ApiHelp extends ApiBase { * @param IContextSource $context * @param ApiBase[]|ApiBase $modules * @param array $options Formatting options (described above) - * @return string */ public static function getHelp( IContextSource $context, $modules, array $options ) { global $wgContLang; diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index dde678fc45..87656f28e3 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -147,8 +147,6 @@ class MWDebug { * @param string $log 'production' will always trigger a php error, 'auto' * will trigger an error if $wgDevelopmentWarnings is true, and 'debug' * will only write to the debug log(s). - * - * @return mixed */ public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE, $log = 'auto' ) { global $wgDevelopmentWarnings; diff --git a/includes/password/ParameterizedPassword.php b/includes/password/ParameterizedPassword.php index c92979798f..78d624ce10 100644 --- a/includes/password/ParameterizedPassword.php +++ b/includes/password/ParameterizedPassword.php @@ -79,7 +79,7 @@ abstract class ParameterizedPassword extends Password { } public function needsUpdate() { - return parent::needsUpdate() || $this->params !== $this->getDefaultParams(); + return $this->params !== $this->getDefaultParams(); } public function toString() { diff --git a/includes/password/Password.php b/includes/password/Password.php index 13d1e6deba..c8a0267cb1 100644 --- a/includes/password/Password.php +++ b/includes/password/Password.php @@ -138,8 +138,7 @@ abstract class Password { * * @return bool True if needs update, false otherwise */ - public function needsUpdate() { - } + abstract public function needsUpdate(); /** * Compare one Password object to this object diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 90bfebd213..0bcb07a5a6 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -104,7 +104,6 @@ abstract class SearchEngine { * @since 1.18 * @param string $feature * @param mixed $data - * @return bool */ public function setFeatureData( $feature, $data ) { $this->features[$feature] = $data; diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index bdf76384c8..fbc3022a43 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -198,9 +198,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { * @param string $subPage Subpage of the special page. * @return string an AuthManager::ACTION_* constant. */ - protected function getDefaultAction( $subPage ) { - throw new BadMethodCallException( 'Subclass did not implement getDefaultAction' ); - } + abstract protected function getDefaultAction( $subPage ); /** * Return custom message key. diff --git a/tests/phan/config.php b/tests/phan/config.php index afcd7f30b1..2c5eef718c 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -331,7 +331,7 @@ return [ "PhanTypeMismatchProperty", // approximate error count: 95 "PhanTypeMismatchReturn", - // approximate error count: 16 + // approximate error count: 11 "PhanTypeMissingReturn", // approximate error count: 5 "PhanTypeNonVarPassByRef",