Merge "Add actual documentation for ContentHandler::getActionOverrides"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 18 May 2016 17:41:05 +0000 (17:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 18 May 2016 17:41:05 +0000 (17:41 +0000)
includes/actions/Action.php
includes/content/ContentHandler.php
includes/page/Article.php
includes/page/WikiPage.php

index 4208b3b..ae4c6d6 100644 (file)
@@ -62,7 +62,7 @@ abstract class Action {
         * the action is disabled, or null if it's not recognised
         * @param string $action
         * @param array $overrides
-        * @return bool|null|string|callable
+        * @return bool|null|string|callable|Action
         */
        final private static function getClass( $action, array $overrides ) {
                global $wgActions;
index f3d6781..e225fb7 100644 (file)
@@ -641,7 +641,12 @@ abstract class ContentHandler {
         *
         * @since 1.21
         *
-        * @return array Always an empty array.
+        * @return array An array mapping action names (typically "view", "edit", "history" etc.) to
+        *  either the full qualified class name of an Action class, a callable taking ( Page $page,
+        *  IContextSource $context = null ) as parameters and returning an Action object, or an actual
+        *  Action object. An empty array in this default implementation.
+        *
+        * @see Action::factory
         */
        public function getActionOverrides() {
                return [];
index 6c42e34..4c9eaed 100644 (file)
@@ -2204,7 +2204,7 @@ class Article implements Page {
 
        /**
         * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::getActionOverrides
+        * @see ContentHandler::getActionOverrides
         */
        public function getActionOverrides() {
                return $this->mPage->getActionOverrides();
index 040a6f3..8702156 100644 (file)
@@ -183,18 +183,12 @@ class WikiPage implements Page, IDBAccessObject {
        }
 
        /**
-        * Returns overrides for action handlers.
-        * Classes listed here will be used instead of the default one when
-        * (and only when) $wgActions[$action] === true. This allows subclasses
-        * to override the default behavior.
-        *
         * @todo Move this UI stuff somewhere else
         *
-        * @return array
+        * @see ContentHandler::getActionOverrides
         */
        public function getActionOverrides() {
-               $content_handler = $this->getContentHandler();
-               return $content_handler->getActionOverrides();
+               return $this->getContentHandler()->getActionOverrides();
        }
 
        /**