Update type hint for CreditsAction::getAuthor()
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 30 Dec 2013 15:41:36 +0000 (16:41 +0100)
committerReedy <reedy@wikimedia.org>
Mon, 30 Dec 2013 18:03:09 +0000 (18:03 +0000)
This function calls $page->getUserText() and $page->getTimestamp(). These
functions are not specified in the interface Page (which actually specifies
nothing at all). Page is only implemented by WikiPage and Article. Article
does not implement getUserText() and getTimestamp(). WikiPage does.
CreditsAction::getAuthor() cannot ever be given an Article, because that
would cause a fatal error "call to undefined method".

Change-Id: I0ba29622b7307845345ce645cb63b53614aaf2ab

includes/actions/CreditsAction.php

index 97c1605..398548a 100644 (file)
@@ -80,10 +80,10 @@ class CreditsAction extends FormlessAction {
 
        /**
         * Get the last author with the last modification time
-        * @param Page $page
+        * @param WikiPage $page
         * @return String HTML
         */
-       protected function getAuthor( Page $page ) {
+       protected function getAuthor( WikiPage $page ) {
                $user = User::newFromName( $page->getUserText(), false );
 
                $timestamp = $page->getTimestamp();