From: umherirrender Date: Wed, 23 Apr 2014 09:20:58 +0000 (+0200) Subject: Fixed some @params documentation (includes/WikiPage.php) X-Git-Tag: 1.31.0-rc.0~16065^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=47c384ebfb0ecbaadb370acb534daa93b8940bd8;p=lhc%2Fweb%2Fwiklou.git Fixed some @params documentation (includes/WikiPage.php) Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Change-Id: Id75b5ecf648ca50f955b3bde3307c82c4366b102 --- diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 0dec76660b..e84f8de6cd 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -59,7 +59,7 @@ class WikiPage implements Page, IDBAccessObject { protected $mId = null; /** - * @var int; one of the READ_* constants + * @var int One of the READ_* constants */ protected $mDataLoadedFrom = self::READ_NONE; @@ -74,7 +74,7 @@ class WikiPage implements Page, IDBAccessObject { protected $mLastRevision = null; /** - * @var string; timestamp of the current revision or empty string if not loaded + * @var string Timestamp of the current revision or empty string if not loaded */ protected $mTimestamp = ''; @@ -95,7 +95,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Constructor and clear the article - * @param $title Title Reference to a Title object. + * @param Title $title Reference to a Title object. */ public function __construct( Title $title ) { $this->mTitle = $title; @@ -135,8 +135,8 @@ class WikiPage implements Page, IDBAccessObject { /** * Constructor from a page id * - * @param int $id article ID to load - * @param string|int $from one of the following values: + * @param int $id Article ID to load + * @param string|int $from One of the following values: * - "fromdb" or WikiPage::READ_NORMAL to select from a slave database * - "fromdbmaster" or WikiPage::READ_LATEST to select from the master database * @@ -161,9 +161,8 @@ class WikiPage implements Page, IDBAccessObject { * Constructor from a database row * * @since 1.20 - * @param $row object: database row containing at least fields returned - * by selectFields(). - * @param string|int $from source of $data: + * @param object $row Database row containing at least fields returned by selectFields(). + * @param string|int $from Source of $data: * - "fromdb" or WikiPage::READ_NORMAL: from a slave DB * - "fromdbmaster" or WikiPage::READ_LATEST: from the master DB * - "forupdate" or WikiPage::READ_LOCKING: from the master DB using SELECT FOR UPDATE @@ -178,7 +177,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Convert 'fromdb', 'fromdbmaster' and 'forupdate' to READ_* constants. * - * @param $type object|string|int + * @param object|string|int $type * @return mixed */ private static function convertSelectType( $type ) { @@ -203,7 +202,7 @@ class WikiPage implements Page, IDBAccessObject { * * @todo Move this UI stuff somewhere else * - * @return Array + * @return array */ public function getActionOverrides() { $content_handler = $this->getContentHandler(); @@ -225,7 +224,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the title object of the article - * @return Title object of this page + * @return Title Title object of this page */ public function getTitle() { return $this->mTitle; @@ -304,10 +303,10 @@ class WikiPage implements Page, IDBAccessObject { /** * Fetch a page record with the given conditions - * @param $dbr DatabaseBase object - * @param $conditions Array - * @param $options Array - * @return mixed Database result resource, or false on failure + * @param DatabaseBase $dbr + * @param array $conditions + * @param array $options + * @return object|false Database result resource, or false on failure */ protected function pageData( $dbr, $conditions, $options = array() ) { $fields = self::selectFields(); @@ -325,10 +324,10 @@ class WikiPage implements Page, IDBAccessObject { * Fetch a page record matching the Title object's namespace and title * using a sanitized title string * - * @param $dbr DatabaseBase object - * @param $title Title object - * @param $options Array - * @return mixed Database result resource, or false on failure + * @param DatabaseBase $dbr + * @param Title $title + * @param array $options + * @return object|false Database result resource, or false on failure */ public function pageDataFromTitle( $dbr, $title, $options = array() ) { return $this->pageData( $dbr, array( @@ -339,10 +338,10 @@ class WikiPage implements Page, IDBAccessObject { /** * Fetch a page record matching the requested ID * - * @param $dbr DatabaseBase - * @param $id Integer - * @param $options Array - * @return mixed Database result resource, or false on failure + * @param DatabaseBase $dbr + * @param int $id + * @param array $options + * @return object|false Database result resource, or false on failure */ public function pageDataFromId( $dbr, $id, $options = array() ) { return $this->pageData( $dbr, array( 'page_id' => $id ), $options ); @@ -352,7 +351,7 @@ class WikiPage implements Page, IDBAccessObject { * Set the general counter, title etc data loaded from * some source. * - * @param $from object|string|int One of the following: + * @param object|string|int $from One of the following: * - A DB query result object * - "fromdb" or WikiPage::READ_NORMAL to get from a slave DB * - "fromdbmaster" or WikiPage::READ_LATEST to get from the master DB @@ -395,8 +394,7 @@ class WikiPage implements Page, IDBAccessObject { * Load the object from a database row * * @since 1.20 - * @param $data object: database row containing at least fields returned - * by selectFields() + * @param object $data Database row containing at least fields returned by selectFields() * @param string|int $from One of the following: * - "fromdb" or WikiPage::READ_NORMAL if the data comes from a slave DB * - "fromdbmaster" or WikiPage::READ_LATEST if the data comes from the master DB @@ -504,7 +502,7 @@ class WikiPage implements Page, IDBAccessObject { * Will use the revisions actual content model if the page exists, * and the page's default if the page doesn't exist yet. * - * @return String + * @return string * * @since 1.21 */ @@ -527,7 +525,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Loads page_touched and returns a value indicating if it should be used - * @return boolean true if not a redirect + * @return bool true if not a redirect */ public function checkTouched() { if ( !$this->mDataLoaded ) { @@ -538,7 +536,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the page_touched field - * @return string containing GMT timestamp + * @return string Containing GMT timestamp */ public function getTouched() { if ( !$this->mDataLoaded ) { @@ -549,7 +547,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the page_links_updated field - * @return string|null containing GMT timestamp + * @return string|null Containing GMT timestamp */ public function getLinksTimestamp() { if ( !$this->mDataLoaded ) { @@ -560,7 +558,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the page_latest field - * @return integer rev_id of current revision + * @return int rev_id of current revision */ public function getLatest() { if ( !$this->mDataLoaded ) { @@ -638,6 +636,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Set the latest revision + * @param Revision $revision */ protected function setLastEdit( Revision $revision ) { $this->mLastRevision = $revision; @@ -659,12 +658,12 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the content of the current revision. No side-effects... * - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to $wgUser - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter + * @param int $audience int One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to $wgUser + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter * @return Content|null The content of the current revision * * @since 1.21 @@ -680,13 +679,13 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the text of the current revision. No side-effects... * - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to the given user - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter - * @return String|false The text of the current revision + * @param int $audience One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to the given user + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter + * @return string|false The text of the current revision * @deprecated since 1.21, getContent() should be used instead. */ public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo deprecated, replace usage! @@ -702,7 +701,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the text of the current revision. No side-effects... * - * @return String|bool The text of the current revision. False on failure + * @return string|bool The text of the current revision. False on failure * @deprecated since 1.21, getContent() should be used instead. */ public function getRawText() { @@ -733,12 +732,12 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to the given user - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter + * @param int $audience One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to the given user + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter * @return int user ID for the user that made the last article revision */ public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) { @@ -752,12 +751,12 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the User object of the user who created the page - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to the given user - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter + * @param int $audience One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to the given user + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter * @return User|null */ public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) { @@ -771,12 +770,12 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to the given user - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter + * @param int $audience One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to the given user + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter * @return string username of the user that made the last article revision */ public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) { @@ -789,12 +788,12 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param $audience Integer: one of: - * Revision::FOR_PUBLIC to be displayed to all users - * Revision::FOR_THIS_USER to be displayed to the given user - * Revision::RAW get the text regardless of permissions - * @param $user User object to check for, only if FOR_THIS_USER is passed - * to the $audience parameter + * @param int $audience One of: + * Revision::FOR_PUBLIC to be displayed to all users + * Revision::FOR_THIS_USER to be displayed to the given user + * Revision::RAW get the text regardless of permissions + * @param User $user User object to check for, only if FOR_THIS_USER is passed + * to the $audience parameter * @return string Comment stored for the last article revision */ public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) { @@ -809,7 +808,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Returns true if last revision was marked as "minor edit" * - * @return boolean Minor edit indicator for the last article revision. + * @return bool Minor edit indicator for the last article revision. */ public function getMinorEdit() { $this->loadLastEdit(); @@ -834,7 +833,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Set the cached timestamp for the last time the page changed. * This is only used to help handle slave lag by comparing to page_touched. - * @param $timestamp string + * @param string $timestamp * @return void */ public function setCachedLastEditTime( $timestamp ) { @@ -847,9 +846,9 @@ class WikiPage implements Page, IDBAccessObject { * Determine whether a page would be suitable for being counted as an * article in the site_stats table based on the title & its content * - * @param $editInfo Object|bool (false): object returned by prepareTextForEdit(), - * if false, the current database state will be used - * @return Boolean + * @param object|bool $editInfo (false): object returned by prepareTextForEdit(), + * if false, the current database state will be used + * @return bool */ public function isCountable( $editInfo = false ) { global $wgArticleCountMethod; @@ -893,7 +892,7 @@ class WikiPage implements Page, IDBAccessObject { * * The target will be fetched from the redirect table if possible. * If this page doesn't have an entry there, call insertRedirect() - * @return Title|mixed object, or null if this page is not a redirect + * @return Title|null Title object, or null if this page is not a redirect */ public function getRedirectTarget() { if ( !$this->mTitle->isRedirect() ) { @@ -929,7 +928,7 @@ class WikiPage implements Page, IDBAccessObject { * Insert an entry for this page into the redirect table. * * Don't call this function directly unless you know what you're doing. - * @return Title object or null if not a redirect + * @return Title|null Title object or null if not a redirect */ public function insertRedirect() { // recurse through to only get the final target @@ -945,7 +944,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Insert or update the redirect table entry for this page to indicate * it redirects to $rt . - * @param $rt Title redirect target + * @param Title $rt Redirect target */ public function insertRedirectEntry( $rt ) { $dbw = wfGetDB( DB_MASTER ); @@ -964,7 +963,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the Title object or URL this page redirects to * - * @return mixed false, Title of in-wiki target, or string with URL + * @return bool|Title|string false, Title of in-wiki target, or string with URL */ public function followRedirect() { return $this->getRedirectURL( $this->getRedirectTarget() ); @@ -974,8 +973,8 @@ class WikiPage implements Page, IDBAccessObject { * Get the Title object or URL to use for a redirect. We use Title * objects for same-wiki, non-special redirects and URLs for everything * else. - * @param $rt Title Redirect target - * @return mixed false, Title object of local target, or string with URL + * @param Title $rt Redirect target + * @return bool|Title|string false, Title object of local target, or string with URL */ public function getRedirectURL( $rt ) { if ( !$rt ) { @@ -1067,7 +1066,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the last N authors * @param int $num Number of revisions to get - * @param int|string $revLatest the latest rev_id, selected from the master (optional) + * @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 ) { @@ -1119,9 +1118,9 @@ class WikiPage implements Page, IDBAccessObject { /** * Should the parser cache be used? * - * @param $parserOptions ParserOptions to check - * @param $oldid int - * @return boolean + * @param ParserOptions $parserOptions ParserOptions to check + * @param int $oldid + * @return bool */ public function isParserCacheUsed( ParserOptions $parserOptions, $oldid ) { global $wgEnableParserCache; @@ -1140,9 +1139,9 @@ class WikiPage implements Page, IDBAccessObject { * @since 1.19 * @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) + * get the current revision (default value) * - * @return ParserOutput or false if the revision was not found + * @return ParserOutput|bool ParserOutput or false if the revision was not found */ public function getParserOutput( ParserOptions $parserOptions, $oldid = null ) { wfProfileIn( __METHOD__ ); @@ -1247,7 +1246,7 @@ class WikiPage implements Page, IDBAccessObject { * or else the record will be left in a funky state. * Best if all done inside a transaction. * - * @param $dbw DatabaseBase + * @param DatabaseBase $dbw * @return int The newly created page_id key, or false if the title already existed */ public function insertOn( $dbw ) { @@ -1283,15 +1282,14 @@ class WikiPage implements Page, IDBAccessObject { /** * Update the page record to point to a newly saved revision. * - * @param $dbw DatabaseBase: object - * @param $revision Revision: For ID number, and text used to set - * length and redirect status fields - * @param $lastRevision Integer: if given, will not overwrite the page field - * when different from the currently set value. - * Giving 0 indicates the new page flag should be set - * on. - * @param $lastRevIsRedirect Boolean: if given, will optimize adding and - * removing rows in redirect table. + * @param DatabaseBase $dbw + * @param Revision $revision For ID number, and text used to set + * length and redirect status fields + * @param int $lastRevision If given, will not overwrite the page field + * when different from the currently set value. + * Giving 0 indicates the new page flag should be set on. + * @param bool $lastRevIsRedirect If given, will optimize adding and + * removing rows in redirect table. * @return bool true on success, false on failure * @private */ @@ -1348,11 +1346,11 @@ class WikiPage implements Page, IDBAccessObject { /** * Add row to the redirect table if this is a redirect, remove otherwise. * - * @param $dbw DatabaseBase - * @param $redirectTitle Title object pointing to the redirect target, - * or NULL if this is not a redirect - * @param $lastRevIsRedirect null|bool If given, will optimize adding and - * removing rows in redirect table. + * @param DatabaseBase $dbw + * @param Title $redirectTitle Title object pointing to the redirect target, + * or NULL if this is not a redirect + * @param null|bool $lastRevIsRedirect If given, will optimize adding and + * removing rows in redirect table. * @return bool true on success, false on failure * @private */ @@ -1387,9 +1385,9 @@ class WikiPage implements Page, IDBAccessObject { * If the given revision is newer than the currently set page_latest, * update the page record. Otherwise, do nothing. * - * @param $dbw DatabaseBase object - * @param $revision Revision object - * @return mixed + * @param DatabaseBase $dbw + * @param Revision $revision + * @return bool */ public function updateIfNewerOn( $dbw, $revision ) { wfProfileIn( __METHOD__ ); @@ -1425,8 +1423,8 @@ class WikiPage implements Page, IDBAccessObject { * Get the content that needs to be saved in order to undo all revisions * between $undo and $undoafter. Revisions must belong to the same page, * must exist and must not be deleted - * @param $undo Revision - * @param $undoafter Revision Must be an earlier revision than $undo + * @param Revision $undo + * @param Revision $undoafter Must be an earlier revision than $undo * @return mixed string on success, false on failure * @since 1.21 * Before we had the Content object, this was done in getUndoText @@ -1440,9 +1438,9 @@ class WikiPage implements Page, IDBAccessObject { * Get the text that needs to be saved in order to undo all revisions * between $undo and $undoafter. Revisions must belong to the same page, * must exist and must not be deleted - * @param $undo Revision - * @param $undoafter Revision Must be an earlier revision than $undo - * @return mixed string on success, false on failure + * @param Revision $undo + * @param Revision $undoafter Must be an earlier revision than $undo + * @return string|bool string on success, false on failure * @deprecated since 1.21: use ContentHandler::getUndoContent() instead. */ public function getUndoText( Revision $undo, Revision $undoafter = null ) { @@ -1469,7 +1467,7 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param mixed $section Null/false, a section number (0, 1, 2, T1, T2, ...) or "new". + * @param string|null|bool $section Null/false, a section number (0, 1, 2, T1, T2, ...) or "new". * @param string $text New text of the section. * @param string $sectionTitle New section's subject, only if $section is "new". * @param string $edittime Revision timestamp or null to use the current revision. @@ -1514,7 +1512,7 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param mixed $section Null/false, a section number (0, 1, 2, T1, T2, ...) or "new". + * @param string|null|bool $section Null/false, a section number (0, 1, 2, T1, T2, ...) or "new". * @param Content $sectionContent New content of the section. * @param string $sectionTitle New section's subject, only if $section is "new". * @param string $edittime Revision timestamp or null to use the current revision. @@ -1571,8 +1569,8 @@ class WikiPage implements Page, IDBAccessObject { /** * Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed. - * @param $flags Int - * @return Int updated $flags + * @param int $flags + * @return int Updated $flags */ public function checkFlags( $flags ) { if ( !( $flags & EDIT_NEW ) && !( $flags & EDIT_UPDATE ) ) { @@ -1590,9 +1588,9 @@ class WikiPage implements Page, IDBAccessObject { * Change an existing article or create a new article. Updates RC and all necessary caches, * optionally via the deferred update array. * - * @param string $text new text - * @param string $summary edit summary - * @param $flags Integer bitfield: + * @param string $text New text + * @param string $summary Edit summary + * @param int $flags Bitfield: * EDIT_NEW * Article is known or assumed to be non-existent, create a new one * EDIT_UPDATE @@ -1614,8 +1612,8 @@ class WikiPage implements Page, IDBAccessObject { * 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|int $baseRevId int the revision ID this edit was based off, if any - * @param $user User the user doing the edit + * @param bool|int $baseRevId The revision ID this edit was based off, if any + * @param User $user The user doing the edit * * @throws MWException * @return Status object. Possible errors: @@ -1647,9 +1645,9 @@ class WikiPage implements Page, IDBAccessObject { * Change an existing article or create a new article. Updates RC and all necessary caches, * optionally via the deferred update array. * - * @param $content Content: new content - * @param string $summary edit summary - * @param $flags Integer bitfield: + * @param Content $content New content + * @param string $summary Edit summary + * @param int $flags Bitfield: * EDIT_NEW * Article is known or assumed to be non-existent, create a new one * EDIT_UPDATE @@ -1671,9 +1669,9 @@ class WikiPage implements Page, IDBAccessObject { * 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|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 + * @param bool|int $baseRevId The revision ID this edit was based off, if any + * @param User $user The user doing the edit + * @param string $serialisation_format Format for storing the content in the database * * @throws MWException * @return Status object. Possible errors: @@ -2034,6 +2032,7 @@ class WikiPage implements Page, IDBAccessObject { * Returns a stdclass with source, pst and output members * * @deprecated since 1.21: use prepareContentForEdit instead. + * @return object */ public function prepareTextForEdit( $text, $revid = null, User $user = null ) { ContentHandler::deprecated( __METHOD__, '1.21' ); @@ -2108,9 +2107,9 @@ class WikiPage implements Page, IDBAccessObject { * Purges pages that include this page if the text was changed here. * Every 100th edit, prune the recent changes table. * - * @param $revision Revision object - * @param $user User object that did the revision - * @param array $options of options, following indexes are used: + * @param Revision $revision + * @param User $user User object that did the revision + * @param array $options Array of options, following indexes are used: * - changed: boolean, whether the revision changed the content (default true) * - created: boolean, whether the revision created the page (default false) * - oldcountable: boolean or null (default null): @@ -2239,10 +2238,10 @@ class WikiPage implements Page, IDBAccessObject { * The article must already exist; link tables etc * are not updated, caches are not flushed. * - * @param string $text text submitted - * @param $user User The relevant user - * @param string $comment comment submitted - * @param $minor Boolean: whereas it's a minor modification + * @param string $text Text submitted + * @param User $user The relevant user + * @param string $comment Comment submitted + * @param bool $minor Whereas it's a minor modification * * @deprecated since 1.21, use doEditContent() instead. */ @@ -2292,8 +2291,8 @@ class WikiPage implements Page, IDBAccessObject { * Update the article's restriction field, and leave a log entry. * This works for protection both existing and non-existing pages. * - * @param array $limit set of restriction keys - * @param array $expiry per restriction type expiration + * @param array $limit Set of restriction keys + * @param array $expiry Per restriction type expiration * @param int &$cascade Set to false if cascading protection isn't allowed. * @param string $reason * @param User $user The user updating the restrictions @@ -2502,12 +2501,12 @@ class WikiPage implements Page, IDBAccessObject { /** * Insert a new null revision for this page. * - * @param string $revCommentMsg comment message key for the revision - * @param array $limit set of restriction keys - * @param array $expiry per restriction type expiration + * @param string $revCommentMsg Comment message key for the revision + * @param array $limit Set of restriction keys + * @param array $expiry Per restriction type expiration * @param int $cascade Set to false if cascading protection isn't allowed. * @param string $reason - * @return Revision|null on error + * @return Revision|null Null on error */ public function insertProtectNullRevision( $revCommentMsg, array $limit, array $expiry, $cascade, $reason ) { global $wgContLang; @@ -2572,8 +2571,8 @@ class WikiPage implements Page, IDBAccessObject { /** * Builds the description to serve as comment for the edit. * - * @param array $limit set of restriction keys - * @param array $expiry per restriction type expiration + * @param array $limit Set of restriction keys + * @param array $expiry Per restriction type expiration * @return string */ public function protectDescription( array $limit, array $expiry ) { @@ -2613,8 +2612,8 @@ class WikiPage implements Page, IDBAccessObject { * protect description text. Keep them in old format to avoid breaking compatibility. * TODO: Fix protection log to store structured description and format it on-the-fly. * - * @param array $limit set of restriction keys - * @param array $expiry per restriction type expiration + * @param array $limit Set of restriction keys + * @param array $expiry Per restriction type expiration * @return string */ public function protectDescriptionLog( array $limit, array $expiry ) { @@ -2661,14 +2660,14 @@ class WikiPage implements Page, IDBAccessObject { * * Deletes the article with database consistency, writes logs, purges caches * - * @param string $reason delete reason for deletion log - * @param $suppress boolean suppress all revisions and log the deletion in + * @param string $reason Delete reason for deletion log + * @param bool $suppress Suppress all revisions and log the deletion in * the suppression log instead of the deletion log - * @param int $id article ID - * @param $commit boolean defaults to true, triggers transaction end - * @param &$error Array of errors to append to - * @param $user User The deleting user - * @return boolean true if successful + * @param int $id Article ID + * @param bool $commit Defaults to true, triggers transaction end + * @param array &$error Array of errors to append to + * @param User $user The deleting user + * @return bool true if successful */ public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null @@ -2683,16 +2682,16 @@ class WikiPage implements Page, IDBAccessObject { * * @since 1.19 * - * @param string $reason delete reason for deletion log - * @param $suppress boolean suppress all revisions and log the deletion in - * the suppression log instead of the deletion log - * @param int $id article ID - * @param $commit boolean defaults to true, triggers transaction end - * @param &$error Array of errors to append to - * @param $user User The deleting user - * @return Status: Status object; if successful, $status->value is the log_id of the - * deletion log entry. If the page couldn't be deleted because it wasn't - * found, $status is a non-fatal 'cannotdelete' error + * @param string $reason Delete reason for deletion log + * @param bool $suppress Suppress all revisions and log the deletion in + * the suppression log instead of the deletion log + * @param int $id Article ID + * @param bool $commit Defaults to true, triggers transaction end + * @param array &$error Array of errors to append to + * @param User $user The deleting user + * @return Status Status object; if successful, $status->value is the log_id of the + * deletion log entry. If the page couldn't be deleted because it wasn't + * found, $status is a non-fatal 'cannotdelete' error */ public function doDeleteArticleReal( $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null @@ -2825,8 +2824,8 @@ class WikiPage implements Page, IDBAccessObject { * Do some database updates after deletion * * @param int $id page_id value of the page being deleted - * @param $content Content: optional page content to be used when determining the required updates. - * This may be needed because $this->getContent() may already return null when the page proper was deleted. + * @param Content $content Optional page content to be used when determining the required updates. + * This may be needed because $this->getContent() may already return null when the page proper was deleted. */ public function doDeleteUpdates( $id, Content $content = null ) { // update site status @@ -2866,14 +2865,14 @@ class WikiPage implements Page, IDBAccessObject { * @param string $fromP Name of the user whose edits to rollback. * @param string $summary Custom summary. Set to default summary if empty. * @param string $token Rollback token. - * @param $bot Boolean: If true, mark all reverted edits as bot. + * @param bool $bot If true, mark all reverted edits as bot. * * @param array $resultDetails contains result-specific array of additional values * 'alreadyrolled' : 'current' (rev) * success : 'summary' (str), 'current' (rev), 'target' (rev) * - * @param $user User The user performing the rollback - * @return array of errors, each error formatted as + * @param User $user The user performing the rollback + * @return array Array of errors, each error formatted as * array(messagekey, param1, param2, ...). * On success, the array is empty. This array can also be passed to * OutputPage::showPermissionsErrorPage(). @@ -2914,10 +2913,10 @@ class WikiPage implements Page, IDBAccessObject { * doRollback() instead. * @param string $fromP Name of the user whose edits to rollback. * @param string $summary Custom summary. Set to default summary if empty. - * @param $bot Boolean: If true, mark all reverted edits as bot. + * @param bool $bot If true, mark all reverted edits as bot. * - * @param array $resultDetails contains result-specific array of additional values - * @param $guser User The user performing the rollback + * @param array $resultDetails Contains result-specific array of additional values + * @param User $guser The user performing the rollback * @return array */ public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser ) { @@ -3070,7 +3069,7 @@ class WikiPage implements Page, IDBAccessObject { * * This is called on page move and undelete, as well as edit * - * @param $title Title object + * @param Title $title */ public static function onArticleCreate( $title ) { // Update existence markers on article/talk tabs... @@ -3091,7 +3090,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Clears caches when article is deleted * - * @param $title Title + * @param Title $title */ public static function onArticleDelete( $title ) { // Update existence markers on article/talk tabs... @@ -3137,7 +3136,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Purge caches on page update etc * - * @param $title Title object + * @param Title $title * @todo Verify that $title is always a Title object (and never false or null), add Title hint to parameter $title */ public static function onArticleEdit( $title ) { @@ -3184,7 +3183,7 @@ class WikiPage implements Page, IDBAccessObject { * Returns a list of hidden categories this page is a member of. * Uses the page_props and categorylinks tables. * - * @return Array of Title objects + * @return array Array of Title objects */ public function getHiddenCategories() { $result = array(); @@ -3212,9 +3211,9 @@ class WikiPage implements Page, IDBAccessObject { /** * Return an applicable autosummary if one exists for the given edit. - * @param string|null $oldtext the previous text of the page. + * @param string|null $oldtext The previous text of the page. * @param string|null $newtext The submitted text of the page. - * @param int $flags bitmask: a bitmask of flags submitted for the edit. + * @param int $flags Bitmask: a bitmask of flags submitted for the edit. * @return string An appropriate autosummary, or an empty string. * * @deprecated since 1.21, use ContentHandler::getAutosummary() instead @@ -3234,8 +3233,8 @@ class WikiPage implements Page, IDBAccessObject { /** * Auto-generates a deletion reason * - * @param &$hasHistory Boolean: whether the page has a history - * @return mixed String containing deletion reason or empty string, or boolean false + * @param bool &$hasHistory Whether the page has a history + * @return string|bool String containing deletion reason or empty string, or boolean false * if no revision occurred */ public function getAutoDeleteReason( &$hasHistory ) { @@ -3246,7 +3245,7 @@ class WikiPage implements Page, IDBAccessObject { * Update all the appropriate counts in the category table, given that * we've added the categories $added and deleted the categories $deleted. * - * @param array $added The names of categories that were added + * @param array $added The names of categories that were added * @param array $deleted The names of categories that were deleted */ public function updateCategoryCounts( array $added, array $deleted ) { @@ -3313,7 +3312,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Updates cascading protections * - * @param $parserOutput ParserOutput object for the current version + * @param ParserOutput $parserOutput ParserOutput object for the current version */ public function doCascadeProtectionUpdates( ParserOutput $parserOutput ) { if ( wfReadOnly() || !$this->mTitle->areRestrictionsCascading() ) { @@ -3381,7 +3380,7 @@ class WikiPage implements Page, IDBAccessObject { * Uses the templatelinks table * * @deprecated since 1.19; use Title::getTemplateLinksFrom() - * @return Array of Title objects + * @return array Array of Title objects */ public function getUsedTemplates() { return $this->mTitle->getTemplateLinksFrom(); @@ -3392,11 +3391,11 @@ class WikiPage implements Page, IDBAccessObject { * so we can do things like signatures and links-in-context. * * @deprecated since 1.19; use Parser::preSaveTransform() instead - * @param string $text article contents - * @param $user User object: user doing the edit - * @param $popts ParserOptions object: parser options, default options for - * the user loaded if null given - * @return string article contents with altered wikitext markup (signatures + * @param string $text Article contents + * @param User $user User doing the edit + * @param ParserOptions $popts Parser options, default options for + * the user loaded if null given + * @return string Article contents with altered wikitext markup (signatures * converted, {{subst:}}, templates, etc.) */ public function preSaveTransform( $text, User $user = null, ParserOptions $popts = null ) { @@ -3439,11 +3438,11 @@ class WikiPage implements Page, IDBAccessObject { * Update the article's restriction field, and leave a log entry. * * @deprecated since 1.19 - * @param array $limit set of restriction keys - * @param $reason String - * @param &$cascade Integer. Set to false if cascading protection isn't allowed. - * @param array $expiry per restriction type expiration - * @param $user User The user updating the restrictions + * @param array $limit Set of restriction keys + * @param string $reason + * @param int &$cascade Set to false if cascading protection isn't allowed. + * @param array $expiry Per restriction type expiration + * @param User $user The user updating the restrictions * @return bool true on success */ public function updateRestrictions( @@ -3460,8 +3459,8 @@ class WikiPage implements Page, IDBAccessObject { * Returns a list of updates to be performed when this page is deleted. The updates should remove any information * about this page from secondary data stores such as links tables. * - * @param Content|null $content optional Content object for determining the necessary updates - * @return Array an array of DataUpdates objects + * @param Content|null $content Optional Content object for determining the necessary updates + * @return array An array of DataUpdates objects */ public function getDeletionUpdates( Content $content = null ) { if ( !$content ) { @@ -3495,7 +3494,7 @@ class PoolWorkArticleView extends PoolCounterWork { private $cacheKey; /** - * @var integer + * @var int */ private $revid; @@ -3527,11 +3526,11 @@ class PoolWorkArticleView extends PoolCounterWork { /** * Constructor * - * @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 - * @param $content Content|String: content to parse or null to load it; may also be given as a wikitext string, for BC + * @param Page $page + * @param int $revid ID of the revision being parsed + * @param bool $useParserCache Whether to use the parser cache + * @param ParserOptions $parserOptions ParserOptions to use for the parse operation + * @param Content|string $content Content to parse or null to load it; may also be given as a wikitext string, for BC */ public function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $content = null ) { if ( is_string( $content ) ) { // BC: old style call @@ -3673,7 +3672,7 @@ class PoolWorkArticleView extends PoolCounterWork { } /** - * @param $status Status + * @param Status $status * @return bool */ public function error( $status ) {