Reduce some duplication in Action::getRestriction(), all but 2 (plus one extension...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 6 Dec 2011 17:40:12 +0000 (17:40 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 6 Dec 2011 17:40:12 +0000 (17:40 +0000)
includes/Action.php
includes/actions/CreditsAction.php
includes/actions/HistoryAction.php
includes/actions/InfoAction.php
includes/actions/MarkpatrolledAction.php
includes/actions/PurgeAction.php
includes/actions/RawAction.php
includes/actions/RevertAction.php
includes/actions/RevisiondeleteAction.php
includes/actions/WatchAction.php

index 09d590a..b5e54d9 100644 (file)
@@ -201,8 +201,11 @@ abstract class Action {
        /**
         * Get the permission required to perform this action.  Often, but not always,
         * the same as the action name
+        * @return String|null
         */
-       public abstract function getRestriction();
+       public function getRestriction() {
+               return null;
+       }
 
        /**
         * Checks if the given user (identified by an object) can perform this action.  Can be
index f28159f..3b2f77e 100644 (file)
@@ -29,10 +29,6 @@ class CreditsAction extends FormlessAction {
                return 'credits';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        protected function getDescription() {
                return wfMsg( 'creditspage' );
        }
index bae484b..aa1ec45 100644 (file)
@@ -23,10 +23,6 @@ class HistoryAction extends FormlessAction {
                return 'history';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresWrite() {
                return false;
        }
index 715f1f9..e3e80e3 100644 (file)
@@ -29,10 +29,6 @@ class InfoAction extends FormlessAction {
                return 'info';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        protected function getDescription() {
                return '';
        }
index b4d41f1..ae9223f 100644 (file)
@@ -28,10 +28,6 @@ class MarkpatrolledAction extends FormlessAction {
                return 'markpatrolled';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        protected function getDescription() {
                return '';
        }
index e288785..21a6d90 100644 (file)
@@ -31,10 +31,6 @@ class PurgeAction extends FormAction {
                return 'purge';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresUnblock() {
                return false;
        }
index 67d3117..6bf7a53 100644 (file)
@@ -24,10 +24,6 @@ class RawAction extends FormlessAction {
                return 'raw';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresWrite() {
                return false;
        }
index f002ef1..567d0c3 100644 (file)
@@ -34,10 +34,6 @@ class RevertAction extends Action {
                return 'revert';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function show() {
                $this->getOutput()->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
        }
index 2ac03d1..f07e493 100644 (file)
@@ -29,10 +29,6 @@ class RevisiondeleteAction extends FormlessAction {
                return 'revisiondelete';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresUnblock() {
                return false;
        }
index f4d6d50..d72fff1 100644 (file)
@@ -26,10 +26,6 @@ class WatchAction extends FormAction {
                return 'watch';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresUnblock() {
                return false;
        }