Remove return from Action::checkCanExecute
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 3 Aug 2014 18:42:25 +0000 (20:42 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Tue, 12 Aug 2014 16:17:27 +0000 (18:17 +0200)
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
includes/actions/Action.php
includes/actions/WatchAction.php

index e7ff835..fb260e1 100644 (file)
@@ -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
index 839d0ed..7dd4616 100644 (file)
@@ -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;
        }
 
        /**
index cc18d3d..8d94bb3 100644 (file)
@@ -85,7 +85,7 @@ class WatchAction extends FormAction {
                        throw new UserNotLoggedIn( 'watchlistanontext', 'watchnologin' );
                }
 
-               return parent::checkCanExecute( $user );
+               parent::checkCanExecute( $user );
        }
 
        /**