From 226760304e212518864cf8d48e23af8c06d917d9 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 3 Aug 2014 20:42:25 +0200 Subject: [PATCH] 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 --- RELEASE-NOTES-1.24 | 1 + includes/actions/Action.php | 2 -- includes/actions/WatchAction.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) 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 ); } /** -- 2.20.1