Add actual documentation for ContentHandler::getActionOverrides
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Wed, 18 May 2016 13:49:26 +0000 (15:49 +0200)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Wed, 18 May 2016 13:49:26 +0000 (15:49 +0200)
Change-Id: I7fd803204ad137dd3510ea321ff7e6fa11d910c0

includes/actions/Action.php
includes/content/ContentHandler.php
includes/page/Article.php
includes/page/WikiPage.php

index 839d7b2..84bf16e 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();
        }
 
        /**