Merge "Fixup parameter type hints"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 8 Oct 2013 17:31:22 +0000 (17:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 8 Oct 2013 17:31:22 +0000 (17:31 +0000)
1  2 
includes/WikiPage.php

diff --combined includes/WikiPage.php
@@@ -541,6 -541,7 +541,7 @@@ class WikiPage implements Page, IDBAcce
                $db = wfGetDB( DB_SLAVE );
                $revSelectFields = Revision::selectFields();
  
+               $row = null;
                while ( $continue ) {
                        $row = $db->selectRow(
                                array( 'page', 'revision' ),
  
        /**
         * Get the last N authors
-        * @param $num Integer: number of revisions to get
-        * @param string $revLatest the latest rev_id, selected from the master (optional)
+        * @param int $num Number of revisions to get
+        * @param int|string $revLatest the latest rev_id, selected from the master (optional)
         * @return array Array of authors, duplicates not removed
         */
        public function getLastNAuthors( $num, $revLatest = 0 ) {
         * The parser cache will be used if possible.
         *
         * @since 1.19
-        * @param $parserOptions ParserOptions to use for the parse operation
-        * @param $oldid Revision ID to get the text from, passing null or 0 will
+        * @param ParserOptions $parserOptions ParserOptions to use for the parse operation
+        * @param null|int $oldid Revision ID to get the text from, passing null or 0 will
         *               get the current revision (default value)
         *
         * @return ParserOutput or false if the revision was not found
         * edit-already-exists error will be returned. These two conditions are also possible with
         * auto-detection due to MediaWiki's performance-optimised locking strategy.
         *
-        * @param bool|\the $baseRevId the revision ID this edit was based off, if any
+        * @param bool|int $baseRevId the revision ID this edit was based off, if any
         * @param $user User the user doing the edit
         * @param $serialisation_format String: format for storing the content in the database
         *
  
                $editInfo = $this->prepareContentForEdit( $content, null, $user, $serialisation_format );
                $serialized = $editInfo->pst;
+               /**
+                * @var Content $content
+                */
                $content = $editInfo->pstContent;
                $newsize = $content->getSize();
  
                ContentHandler::deprecated( __METHOD__, "1.21" );
  
                $content = ContentHandler::makeContent( $text, $this->getTitle() );
-               return $this->doQuickEditContent( $content, $user, $comment, $minor );
+               $this->doQuickEditContent( $content, $user, $comment, $minor );
        }
  
        /**
                                }
                        }
  
 +                      // Clear out legacy restriction fields
 +                      $dbw->update(
 +                              'page',
 +                              array( 'page_restrictions' => '' ),
 +                              array( 'page_id' => $id ),
 +                              __METHOD__
 +                      );
 +
                        wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $nullRevision, $latest, $user ) );
                        wfRunHooks( 'ArticleProtectComplete', array( &$this, &$user, $limit, $reason ) );
                } else { // Protection of non-existing page (also known as "title protection")
        public function viewUpdates() {
                wfDeprecated( __METHOD__, '1.18' );
                global $wgUser;
-               return $this->doViewUpdates( $wgUser );
+               $this->doViewUpdates( $wgUser );
        }
  
        /**
@@@ -3438,7 -3435,7 +3443,7 @@@ class PoolWorkArticleView extends PoolC
        /**
         * Constructor
         *
-        * @param $page Page
+        * @param $page Page|WikiPage
         * @param $revid Integer: ID of the revision being parsed
         * @param $useParserCache Boolean: whether to use the parser cache
         * @param $parserOptions parserOptions to use for the parse operation
                        return false;
                }
  
 +              // Reduce effects of race conditions for slow parses (bug 46014)
 +              $cacheTime = wfTimestampNow();
 +
                $time = - microtime( true );
                $this->parserOutput = $content->getParserOutput( $this->page->getTitle(), $this->revid, $this->parserOptions );
                $time += microtime( true );
                }
  
                if ( $this->cacheable && $this->parserOutput->isCacheable() ) {
 -                      ParserCache::singleton()->save( $this->parserOutput, $this->page, $this->parserOptions );
 +                      ParserCache::singleton()->save(
 +                              $this->parserOutput, $this->page, $this->parserOptions, $cacheTime );
                }
  
                // Make sure file cache is not used on uncacheable content.