From: umherirrender Date: Sun, 3 Aug 2014 18:42:25 +0000 (+0200) Subject: Remove return from Action::checkCanExecute X-Git-Tag: 1.31.0-rc.0~14462^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=226760304e212518864cf8d48e23af8c06d917d9;p=lhc%2Fweb%2Fwiklou.git Remove return from Action::checkCanExecute No need to return true on success, because failure gives Exception, so the return value needs no checking. Change-Id: Id59bfaebc14bd1c638a721c303f585c1de627508 --- diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index e7ff835502..fb260e1d75 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -318,6 +318,7 @@ changes to languages because of Bugzilla reports. JavaScript is no longer executed in this browser. The IEFixes script, which existed purely to provide support for MSIE versions below 7 and which was conditionally loaded for those browsers, was also removed. +* Action::checkCanExecute() no longer has a return value. ==== Renamed classes ==== * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression diff --git a/includes/actions/Action.php b/includes/actions/Action.php index 839d0edb94..7dd46161ac 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -282,7 +282,6 @@ abstract class Action { * * @param User $user The user to check, or null to use the context user * @throws UserBlockedError|ReadOnlyError|PermissionsError - * @return bool True on success */ protected function checkCanExecute( User $user ) { $right = $this->getRestriction(); @@ -304,7 +303,6 @@ abstract class Action { if ( $this->requiresWrite() && wfReadOnly() ) { throw new ReadOnlyError(); } - return true; } /** diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php index cc18d3dda5..8d94bb3757 100644 --- a/includes/actions/WatchAction.php +++ b/includes/actions/WatchAction.php @@ -85,7 +85,7 @@ class WatchAction extends FormAction { throw new UserNotLoggedIn( 'watchlistanontext', 'watchnologin' ); } - return parent::checkCanExecute( $user ); + parent::checkCanExecute( $user ); } /**