Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/384223 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: I26f0ec72f9bd8f31d86cf38c40dbe06103eb747a --- M api/actions/ApiReview.php M api/actions/ApiReviewActivity.php M api/actions/ApiStabilize.php M api/reports/ApiFlagConfig.php M api/reports/ApiQueryConfiguredPages.php M api/reports/ApiQueryFlagged.php M api/reports/ApiQueryOldreviewedpages.php M api/reports/ApiQueryReviewedpages.php M api/reports/ApiQueryUnreviewedpages.php M backend/FRDependencyUpdate.php M backend/FRExtraCacheUpdate.php M backend/FRPageConfig.php M backend/FRParserCacheStable.php M backend/FlaggableWikiPage.php M backend/FlaggedRevision.php M backend/FlaggedRevs.class.php M backend/FlaggedRevs.hooks.php M backend/FlaggedRevsStats.php M business/PageStabilityForm.php M frontend/FlaggablePageView.php M frontend/FlaggedRevsUI.hooks.php M frontend/RevisionReviewFormUI.php M frontend/specialpages/actions/Stabilization_body.php M frontend/specialpages/reports/ConfiguredPages_body.php M frontend/specialpages/reports/PendingChanges_body.php M frontend/specialpages/reports/ProblemChanges_body.php M frontend/specialpages/reports/StablePages_body.php M frontend/specialpages/reports/UnreviewedPages_body.php M frontend/specialpages/reports/ValidationStatistics_body.php M maintenance/cachePendingRevs.php M phpcs.xml 31 files changed, 307 insertions(+), 72 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/23/384223/1 diff --git a/api/actions/ApiReview.php b/api/actions/ApiReview.php index 4e224de..a46ec02 100644 --- a/api/actions/ApiReview.php +++ b/api/actions/ApiReview.php @@ -269,7 +269,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/actions/ApiReviewActivity.php b/api/actions/ApiReviewActivity.php index c9cc870..765e184 100644 --- a/api/actions/ApiReviewActivity.php +++ b/api/actions/ApiReviewActivity.php @@ -162,7 +162,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/actions/ApiStabilize.php b/api/actions/ApiStabilize.php index c6cb95e..eb805d0 100644 --- a/api/actions/ApiStabilize.php +++ b/api/actions/ApiStabilize.php @@ -221,7 +221,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiFlagConfig.php b/api/reports/ApiFlagConfig.php index 450d145..8035e58 100644 --- a/api/reports/ApiFlagConfig.php +++ b/api/reports/ApiFlagConfig.php @@ -83,7 +83,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiQueryConfiguredPages.php b/api/reports/ApiQueryConfiguredPages.php index 0322fbc..9977433 100644 --- a/api/reports/ApiQueryConfiguredPages.php +++ b/api/reports/ApiQueryConfiguredPages.php @@ -211,7 +211,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiQueryFlagged.php b/api/reports/ApiQueryFlagged.php index df64aa3..0ab64d9 100644 --- a/api/reports/ApiQueryFlagged.php +++ b/api/reports/ApiQueryFlagged.php @@ -113,7 +113,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiQueryOldreviewedpages.php b/api/reports/ApiQueryOldreviewedpages.php index ef8ffbe..a7a938f 100644 --- a/api/reports/ApiQueryOldreviewedpages.php +++ b/api/reports/ApiQueryOldreviewedpages.php @@ -249,7 +249,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiQueryReviewedpages.php b/api/reports/ApiQueryReviewedpages.php index 26e62ba..3e843f1 100644 --- a/api/reports/ApiQueryReviewedpages.php +++ b/api/reports/ApiQueryReviewedpages.php @@ -208,7 +208,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/reports/ApiQueryUnreviewedpages.php b/api/reports/ApiQueryUnreviewedpages.php index 8807c26..db73ad3 100644 --- a/api/reports/ApiQueryUnreviewedpages.php +++ b/api/reports/ApiQueryUnreviewedpages.php @@ -198,7 +198,7 @@ } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/backend/FRDependencyUpdate.php b/backend/FRDependencyUpdate.php index 753ecc4..3e8714a 100644 --- a/backend/FRDependencyUpdate.php +++ b/backend/FRDependencyUpdate.php @@ -93,7 +93,7 @@ } } - /* + /** * Get existing cache dependancies * @param int $flags FR_MASTER * @return array (ns => dbKey => 1) @@ -116,8 +116,10 @@ return $arr; } - /* + /** * Get INSERT rows for cache dependancies in $new but not in $existing + * @param array $existing + * @param array $new * @return array */ protected function getDepInsertions( array $existing, array $new ) { @@ -139,8 +141,10 @@ return $arr; } - /* + /** * Get WHERE clause to delete items in $existing but not in $new + * @param array $existing + * @param array $new * @return mixed (array/false) */ protected function getDepDeletions( array $existing, array $new ) { @@ -161,7 +165,12 @@ return false; } - // Make WHERE clause to match $arr titles + /** + * Make WHERE clause to match $arr titles + * @param array &$arr + * @param IDatabase $db + * @return string|bool + */ protected static function makeWhereFrom2d( &$arr, $db ) { $lb = new LinkBatch(); $lb->setArray( $arr ); diff --git a/backend/FRExtraCacheUpdate.php b/backend/FRExtraCacheUpdate.php index 02bb380..b95a1b4 100644 --- a/backend/FRExtraCacheUpdate.php +++ b/backend/FRExtraCacheUpdate.php @@ -89,6 +89,7 @@ /** * Invalidate a set of IDs, right now + * @param ResultWrapper $res */ public function invalidateIDs( ResultWrapper $res ) { global $wgUseFileCache, $wgUseSquid; diff --git a/backend/FRPageConfig.php b/backend/FRPageConfig.php index 96cabe2..5e046ed 100644 --- a/backend/FRPageConfig.php +++ b/backend/FRPageConfig.php @@ -30,6 +30,7 @@ /** * Get page configuration settings from a DB row * @param stdClass $row + * @return array */ public static function getVisibilitySettingsFromRow( $row ) { if ( $row ) { diff --git a/backend/FRParserCacheStable.php b/backend/FRParserCacheStable.php index e4c3cda..97bd44f 100644 --- a/backend/FRParserCacheStable.php +++ b/backend/FRParserCacheStable.php @@ -7,6 +7,7 @@ class FRParserCacheStable extends ParserCache { /** * Get an instance of this object + * @return self */ public static function singleton() { static $instance; @@ -22,8 +23,8 @@ /** * Like ParserCache::getParserOutputKey() with stable-pcache instead of pcache - * @param $article Article - * @param $hash string + * @param Article $article + * @param string $hash * @return mixed|string */ protected function getParserOutputKey( $article, $hash ) { @@ -33,7 +34,7 @@ /** * Like ParserCache::getOptionsKey() with stable-pcache instead of pcache - * @param $article Article + * @param Article $article * @return mixed|string */ protected function getOptionsKey( $article ) { diff --git a/backend/FlaggableWikiPage.php b/backend/FlaggableWikiPage.php index fcb1fc2..161d627 100644 --- a/backend/FlaggableWikiPage.php +++ b/backend/FlaggableWikiPage.php @@ -17,7 +17,7 @@ /** * Get a FlaggableWikiPage for a given title - * @param $title Title + * @param Title $title * @return FlaggableWikiPage */ public static function getTitleInstance( Title $title ) { @@ -299,7 +299,7 @@ return $this->pageConfig; } - /* + /** * Get the fp_reviewed value for this page * @return bool */ @@ -354,8 +354,8 @@ /** * Fetch a page record with the given conditions - * @param $dbr Database object - * @param $conditions Array + * @param IDatabase $dbr Database object + * @param array $conditions * @param array $options * @return mixed Database result resource, or false on failure */ diff --git a/backend/FlaggedRevision.php b/backend/FlaggedRevision.php index 3e8922a..fc29b0c 100644 --- a/backend/FlaggedRevision.php +++ b/backend/FlaggedRevision.php @@ -341,9 +341,9 @@ return $frev; } - /* + /** * Insert a FlaggedRevision object into the database - * + * * @return bool success */ public function insert() { @@ -409,9 +409,9 @@ return true; } - /* + /** * Remove a FlaggedRevision object from the database - * + * * @return bool success */ public function delete() { diff --git a/backend/FlaggedRevs.class.php b/backend/FlaggedRevs.class.php index 36ef149..4c1ea74 100644 --- a/backend/FlaggedRevs.class.php +++ b/backend/FlaggedRevs.class.php @@ -419,7 +419,7 @@ # ################ Permission functions ################# - /* + /** * Sanity check a (tag,value) pair * @param string $tag * @param int $value @@ -822,7 +822,12 @@ return self::tagsAtLevel( $flags, self::$minPL ); } - // Checks if $flags meets $reqFlagLevels + /** + * Checks if $flags meets $reqFlagLevels + * @param array $flags + * @param array $reqFlagLevels + * @return bool + */ protected static function tagsAtLevel( array $flags, $reqFlagLevels ) { self::load(); if ( empty( $flags ) ) { @@ -925,17 +930,23 @@ /** * Automatically review an revision and add a log entry in the review log. - * + * * This is called during edit operations after the new revision is added * and the page tables updated, but before LinksUpdate is called. - * + * * $auto is here for revisions checked off to be reviewed. Auto-review * triggers on edit, but we don't want those to count as just automatic. * This also makes it so the user's name shows up in the page history. - * + * * If $flags is given, then they will be the review tags. If not, the one * from the stable version will be used or minimal tags if that's not possible. * If no appropriate tags can be found, then the review will abort. + * @param WikiPage $article + * @param User $user + * @param Revision $rev + * @param array $flags + * @param bool $auto + * @return true */ public static function autoReviewEdit( WikiPage $article, $user, Revision $rev, array $flags = null, $auto = true @@ -1058,6 +1069,7 @@ /** * Get JS script params + * @return object */ public static function getJSTagParams() { self::load(); diff --git a/backend/FlaggedRevs.hooks.php b/backend/FlaggedRevs.hooks.php index 2eaa3ae..b48afa3 100644 --- a/backend/FlaggedRevs.hooks.php +++ b/backend/FlaggedRevs.hooks.php @@ -5,6 +5,10 @@ class FlaggedRevsHooks { /** * Update flaggedrevs table on revision restore + * @param Title $title + * @param Revision $revision + * @param int $oldPageID + * @return true */ public static function onRevisionRestore( $title, Revision $revision, $oldPageID ) { $dbw = wfGetDB( DB_MASTER ); @@ -21,6 +25,9 @@ /** * Update flaggedrevs page/tracking tables (revision moving) + * @param Title $sourceTitle + * @param Title $destTitle + * @return true */ public static function onArticleMergeComplete( Title $sourceTitle, Title $destTitle ) { $oldPageID = $sourceTitle->getArticleID(); @@ -58,6 +65,13 @@ /** * (a) Update flaggedrevs page/tracking tables * (b) Autoreview pages moved into reviewable namespaces (bug 19379) + * @param Title $otitle + * @param Title $ntitle + * @param User $user + * @param int $pageId + * @param int $redirid + * @param string $reason + * @return true */ public static function onTitleMoveComplete( Title $otitle, Title $ntitle, $user, $pageId, $redirid, $reason @@ -99,6 +113,9 @@ * (a) Update flaggedrevs page/tracking tables * (b) Pages with stable versions that use this page will be purged * Note: pages with current versions that use this page should already be purged + * @param Page $article + * @param array $editInfo + * @return true */ public static function onArticleEditUpdates( Page $article, $editInfo ) { FlaggedRevs::stableVersionUpdates( $article->getTitle(), null, null, $editInfo ); @@ -110,6 +127,11 @@ * (a) Update flaggedrevs page/tracking tables * (b) Pages with stable versions that use this page will be purged * Note: pages with current versions that use this page should already be purged + * @param Page $article + * @param User $user + * @param string $reason + * @param int $id + * @return true */ public static function onArticleDelete( Page $article, $user, $reason, $id ) { FlaggedRevs::clearTrackingRows( $id ); @@ -121,6 +143,8 @@ * (a) Update flaggedrevs page/tracking tables * (b) Pages with stable versions that use this page will be purged * Note: pages with current versions that use this page should already be purged + * @param Title $title + * @return true */ public static function onArticleUndelete( Title $title ) { FlaggedRevs::stableVersionUpdates( $title ); @@ -132,6 +156,8 @@ * (a) Update flaggedrevs page/tracking tables * (b) Pages with stable versions that use this page will be purged * Note: pages with current versions that use this page should already be purged + * @param File $file + * @return true */ public static function onFileUpload( File $file ) { FlaggedRevs::stableVersionUpdates( $file->getTitle() ); @@ -141,6 +167,8 @@ /** * Update flaggedrevs page/tracking tables + * @param Title $title + * @return true */ public static function onRevisionDelete( Title $title ) { $changed = FlaggedRevs::stableVersionUpdates( $title ); @@ -153,6 +181,11 @@ /** * Select the desired templates based on the selected stable revision IDs * Note: $parser can be false + * @param Parser $parser + * @param Title $title + * @param bool &$skip + * @param int &$id + * @return true */ public static function parserFetchStableTemplate( $parser, Title $title, &$skip, &$id ) { if ( !( $parser instanceof Parser ) ) { @@ -188,6 +221,11 @@ /** * Select the desired images based on the selected stable version time/SHA-1 + * @param Parser $parser + * @param Title $title + * @param array &$options + * @param array &$query + * @return true */ public static function parserFetchStableFile( $parser, Title $title, &$options, &$query ) { if ( !( $parser instanceof Parser ) ) { @@ -309,6 +347,11 @@ /** * Check page move and patrol permissions for FlaggedRevs + * @param Title $title + * @param User $user + * @param string $action + * @param bool &$result + * @return true */ public static function onGetUserPermissionsErrors( Title $title, $user, $action, &$result ) { if ( $result === false ) { @@ -380,6 +423,11 @@ * * Note: RC items not inserted yet, RecentChange_save hook does rc_patrolled bit... * Note: $article one of Article, ImagePage, Category page as appropriate. + * @param Page $article + * @param Revision $rev + * @param int|false $baseRevId + * @param User|null $user + * @return true */ public static function maybeMakeEditReviewed( Page $article, $rev, $baseRevId = false, $user = null @@ -500,8 +548,15 @@ return true; } - // Review $rev if $editTimestamp matches the previous revision's timestamp. - // Otherwise, review the revision that has $editTimestamp as its timestamp value. + /** + * Review $rev if $editTimestamp matches the previous revision's timestamp. + * Otherwise, review the revision that has $editTimestamp as its timestamp value. + * @param Page $article + * @param Revision $rev + * @param User $user + * @param string $editTimestamp + * @return bool + */ protected static function editCheckReview( Page $article, $rev, $user, $editTimestamp ) { @@ -532,6 +587,11 @@ /** * Check if a user reverted himself to the stable version + * @param Revision $rev + * @param Revision $srev + * @param int $baseRevId + * @param User $user + * @return bool */ protected static function isSelfRevertToStable( Revision $rev, $srev, $baseRevId, $user @@ -572,6 +632,18 @@ * (a) Null undo or rollback * (b) Null edit with review box checked * Note: called after edit ops are finished + * @param Page $article + * @param User $user + * @param Content $content + * @param string $s + * @param bool $m + * @param string $a + * @param bool $b + * @param int $flags + * @param Revision $rev + * @param bool &$status + * @param int $baseId + * @return true */ public static function maybeNullEditReview( Page $article, $user, $content, $s, $m, $a, $b, $flags, $rev, &$status, $baseId @@ -641,6 +713,8 @@ /** * Mark auto-reviewed edits as patrolled + * @param RecentChange &$rc + * @return true */ public static function autoMarkPatrolled( RecentChange &$rc ) { if ( empty( $rc->mAttribs['rc_this_oldid'] ) ) { @@ -810,6 +884,9 @@ /** * Checks if $user was previously blocked since $cutoff_unixtime + * @param User $user + * @param int $cutoff_unixtime = 0 + * @return bool */ protected static function wasPreviouslyBlocked( User $user, $cutoff_unixtime = 0 ) { $dbr = wfGetDB( DB_REPLICA ); @@ -859,6 +936,9 @@ /** * Grant 'autoreview' rights to users with the 'bot' right + * @param User $user + * @param array &$rights + * @return true */ public static function onUserGetRights( $user, array &$rights ) { # Make sure bots always have the 'autoreview' right @@ -871,6 +951,16 @@ /** * Callback that autopromotes user according to the setting in * $wgFlaggedRevsAutopromote. This also handles user stats tallies. + * @param Page $article + * @param User $user + * @param Content $content + * @param string $summary + * @param bool $m + * @param string $a + * @param bool $b + * @param int &$f + * @param Revision $rev + * @return true */ public static function onPageContentSaveComplete( Page $article, User $user, $content, $summary, $m, $a, $b, &$f, $rev @@ -897,8 +987,13 @@ /** * Check an autopromote condition that is defined by FlaggedRevs - * + * * Note: some unobtrusive caching is used to avoid DB hits. + * @param int $cond + * @param array $params + * @param User $user + * @param bool &$result + * @return true */ public static function checkAutoPromoteCond( $cond, array $params, User $user, &$result ) { global $wgMemc; diff --git a/backend/FlaggedRevsStats.php b/backend/FlaggedRevsStats.php index ad41f19..89aa5ae 100644 --- a/backend/FlaggedRevsStats.php +++ b/backend/FlaggedRevsStats.php @@ -7,7 +7,7 @@ * Get FR-related stats at a designated snapshot in time. * If no $timestamp is specified, then the latest will be used. * - * @param $timestamp string|bool false TS_ timestamp + * @param string|bool $timestamp false TS_ timestamp * @return array of current FR stats */ public static function getStats( $timestamp = false ) { @@ -67,10 +67,10 @@ return $data; } - /* + /** * Run a stats update and update the DB * Note: this can easily be too expensive to run live - * + * * @return void */ public static function updateCache() { @@ -234,8 +234,8 @@ /** * Get edit review time statistics (as recent as possible) - * @param $stash BagOStuff object - * @param $users string "anons" or "users" + * @param BagOStuff $stash BagOStuff object + * @param string $users string "anons" or "users" * @throws Exception * @return array associative */ diff --git a/business/PageStabilityForm.php b/business/PageStabilityForm.php index 939614a..9e72f0d 100644 --- a/business/PageStabilityForm.php +++ b/business/PageStabilityForm.php @@ -264,6 +264,7 @@ * Do history & log updates: * (a) Add a new stability log entry * (b) Add a null edit like the log entry + * @param FlaggableWikiPage $article * @return Revision */ protected function updateLogsAndHistory( FlaggableWikiPage $article ) { diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php index 8e13744..32b6cc3 100644 --- a/frontend/FlaggablePageView.php +++ b/frontend/FlaggablePageView.php @@ -23,8 +23,9 @@ protected static $instance = null; - /* + /** * Get the FlaggablePageView for this request + * @return self */ public static function singleton() { if ( self::$instance == null ) { @@ -37,7 +38,7 @@ protected function __clone() { } - /* + /** * Clear the FlaggablePageView for this request. * Only needed when page redirection changes the environment. */ @@ -45,7 +46,7 @@ self::$instance = null; } - /* + /** * Load the global FlaggableWikiPage instance */ protected function load() { @@ -766,7 +767,10 @@ ); } - // Show icons for draft/stable/old reviewed versions + /** + * Show icons for draft/stable/old reviewed versions + * @return bool + */ protected function showRatingIcon() { if ( FlaggedRevs::useSimpleConfig() ) { // If there is only one quality level and we have tabs to know @@ -834,7 +838,14 @@ return ''; } - // $n number of in-between revs + /** + * $n number of in-between revs + * @param string $diffBody + * @param string $multiNotice + * @param string $leftStatus + * @param string $rightStatus + * @return string + */ protected function getFormattedDiff( $diffBody, $multiNotice, $leftStatus, $rightStatus ) { @@ -932,6 +943,7 @@ /** * Adds stable version tags to page when viewing history + * @return true */ public function addToHistView() { $this->load(); @@ -1131,6 +1143,7 @@ /** * Add unreviewed pages links + * @return true */ public function addToCategoryView() { $reqUser = $this->getUser(); @@ -1230,6 +1243,7 @@ /** * Add link to stable version setting to protection form + * @return true */ public function addStabilizationLink() { $request = $this->getRequest(); @@ -1344,7 +1358,12 @@ return true; } - // Add "pending changes" tab and set tab selection CSS + /** + * Add "pending changes" tab and set tab selection CSS + * @param array &$views + * @param FlaggedRevision $srev + * @param string $type + */ protected function addDraftTab( array &$views, FlaggedRevision $srev, $type ) { $request = $this->getRequest(); $title = $this->article->getTitle(); // convenience @@ -1488,6 +1507,7 @@ * @param string $diff * @param Revision $oldRev * @param Revision $newRev + * @return true */ public function addToDiffView( $diff, $oldRev, $newRev ) { global $wgMemc, $wgParserCacheExpireTime; @@ -1590,7 +1610,10 @@ return true; } - // get new diff header items for in-place AJAX page review + /** + * get new diff header items for in-place AJAX page review + * @return string + */ public static function AjaxBuildDiffHeaderItems() { $args = func_get_args(); // <oldid, newid> if ( count( $args ) >= 2 ) { @@ -1610,6 +1633,10 @@ * (a) Add a link to diff from stable to current as needed * (b) Show review status of the diff revision(s). Uses a <table>. * Note: used by ajax function to rebuild diff page + * @param FlaggableWikiPage $article + * @param Revision $oldRev + * @param Revision $newRev + * @return string */ public static function diffLinkAndMarkers( FlaggableWikiPage $article, $oldRev, $newRev ) { $s = '<form id="mw-fr-diff-dataform">'; @@ -1625,6 +1652,10 @@ /** * Add a link to diff-to-stable for reviewable pages + * @param FlaggableWikiPage $article + * @param Revision $oldRev + * @param Revision $newRev + * @return string */ protected static function diffToStableLink( FlaggableWikiPage $article, $oldRev, Revision $newRev @@ -1654,6 +1685,10 @@ /** * Add [checked version] and such to left and right side of diff + * @param FlaggableWikiPage $article + * @param Revision $oldRev + * @param Revision $newRev + * @return string */ protected static function diffReviewMarkers( FlaggableWikiPage $article, $oldRev, $newRev ) { $table = ''; @@ -1703,8 +1738,12 @@ return [ $msg, $css ]; } - // Fetch template changes for a reviewed revision since review - // @return array + /** + * Fetch template changes for a reviewed revision since review + * @param FlaggedRevision $frev + * @param array|null $newTemplates + * @return array + */ protected static function fetchTemplateChanges( FlaggedRevision $frev, $newTemplates = null ) { $diffLinks = []; if ( $newTemplates === null ) { @@ -1727,8 +1766,12 @@ return $diffLinks; } - // Fetch file changes for a reviewed revision since review - // @return array + /** + * Fetch file changes for a reviewed revision since review + * @param FlaggedRevision $frev + * @param array|null $newFiles + * @return array + */ protected static function fetchFileChanges( FlaggedRevision $frev, $newFiles = null ) { $diffLinks = []; if ( $newFiles === null ) { @@ -1750,7 +1793,10 @@ /** * Set $this->isDiffFromStable and $this->isMultiPageDiff fields - * Note: $oldRev could be false + * @param string $diff + * @param Revision|false $oldRev + * @param Revision|false $newRev + * @return true */ public function setViewFlags( $diff, $oldRev, $newRev ) { $this->load(); @@ -1779,7 +1825,13 @@ return true; } - // Is a diff from $oldRev to $newRev a diff-to-stable? + /** + * Is a diff from $oldRev to $newRev a diff-to-stable? + * @param bool $srev + * @param Revision $oldRev + * @param Revision $newRev + * @return bool + */ protected static function isDiffToStable( $srev, $oldRev, $newRev ) { return ( $srev && $oldRev && $newRev && $oldRev->getPage() == $newRev->getPage() // no multipage diffs @@ -1791,6 +1843,9 @@ /** * Redirect users out to review the changes to the stable version. * Only for people who can review and for pages that have a stable version. + * @param string &$sectionAnchor + * @param array &$extraQuery + * @return true */ public function injectPostEditURLParams( &$sectionAnchor, &$extraQuery ) { $reqUser = $this->getUser(); @@ -1838,6 +1893,9 @@ * If submitting the edit will leave it pending, then change the button text * Note: interacts with 'review pending changes' checkbox * @TODO: would be nice if hook passed in button attribs, not XML + * @param EditPage $editPage + * @param array &$buttons + * @return true */ public function changeSaveButton( EditPage $editPage, array &$buttons ) { if ( !$this->editWillRequireReview( $editPage ) ) { @@ -1931,6 +1989,10 @@ * Add a "review pending changes" checkbox to the edit form iff: * (a) there are currently any revisions pending (bug 16713) * (b) this is an unreviewed page (bug 23970) + * @param EditPage $editPage + * @param array &$checkboxes + * @param int|null &$tabindex + * @return true */ public function addReviewCheck( EditPage $editPage, array &$checkboxes, &$tabindex = null ) { $this->load(); @@ -1997,6 +2059,8 @@ * (b) If an edit was undone, add a hidden field that has the rev ID of that edit. * Needed for autoreview and user stats (for autopromote). * Note: baseRevId trusted for Reviewers - text checked for others. + * @param EditPage $editPage + * @param OutputPage $out */ public function addRevisionIDField( EditPage $editPage, OutputPage $out ) { $out->addHTML( "\n" . Html::hidden( 'baseRevId', diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php index 6393061..9b12481 100644 --- a/frontend/FlaggedRevsUI.hooks.php +++ b/frontend/FlaggedRevsUI.hooks.php @@ -73,8 +73,11 @@ return true; } - /* + /** * Add tag notice, CSS/JS, protect form link, and set robots policy + * @param OutputPage &$out + * @param Skin &$skin + * @return true */ public static function onBeforePageDisplay( &$out, &$skin ) { if ( $out->getTitle()->getNamespace() != NS_SPECIAL ) { @@ -160,8 +163,13 @@ return true; } - // MonoBook et al: $contentActions is all the tabs - // Vector et al: $contentActions is all the action tabs...unused + /** + * MonoBook et al: $contentActions is all the tabs + * Vector et al: $contentActions is all the action tabs...unused + * @param Skin $skin + * @param array &$contentActions + * @return true + */ public static function onSkinTemplateTabs( Skin $skin, array &$contentActions ) { if ( $skin instanceof SkinVector ) { // *sigh*...skip, dealt with in setNavigation() @@ -175,7 +183,12 @@ return true; } - // Vector et al: $links is all the tabs (2 levels) + /** + * Vector et al: $links is all the tabs (2 levels) + * @param Skin $skin + * @param array &$links + * @return true + */ public static function onSkinTemplateNavigation( Skin $skin, array &$links ) { if ( FlaggablePageView::globalArticleInstance() != null ) { $view = FlaggablePageView::singleton(); @@ -297,6 +310,7 @@ * * @param SpecialPage $specialPage Special page * @param array &$filters Array of filters + * @return true */ public static function addHideReviewedUnstructuredFilter( $specialPage, &$filters ) { if ( !FlaggedRevs::useSimpleConfig() ) { @@ -313,6 +327,7 @@ * * @param ChangesListSpecialPage $specialPage Special page, such as * Special:RecentChanges or Special:Watchlist + * @return true */ public static function addHideReviewedFilter( ChangesListSpecialPage $specialPage ) { if ( FlaggedRevs::useSimpleConfig() ) { @@ -664,7 +679,15 @@ return true; } - // diff=review param (bug 16923) + /** + * diff=review param (bug 16923) + * @param Title $titleObj + * @param int &$mOldid + * @param int &$mNewid + * @param string $old + * @param string $new + * @return true + */ public static function checkDiffUrl( $titleObj, &$mOldid, &$mNewid, $old, $new ) { if ( $new === 'review' && isset( $titleObj ) ) { $sRevId = FlaggedRevision::getStableRevId( $titleObj ); @@ -741,8 +764,13 @@ return true; } - // Add selector of review "protection" options - // Code stolen from Stabilization (which was stolen from ProtectionForm) + /** + * Add selector of review "protection" options + * Code stolen from Stabilization (which was stolen from ProtectionForm) + * @param Page $article + * @param string &$output + * @return true + */ public static function onProtectionForm( Page $article, &$output ) { global $wgUser, $wgOut, $wgRequest, $wgLang; if ( !$article->exists() ) { @@ -888,7 +916,12 @@ return true; } - // Add stability log extract to protection form + /** + * Add stability log extract to protection form + * @param Page $article + * @param OutputPage $out + * @return true + */ public static function insertStabilityLog( Page $article, OutputPage $out ) { if ( !$article->exists() ) { return true; // nothing to do @@ -902,7 +935,12 @@ return true; } - // Update stability config from request + /** + * Update stability config from request + * @param Page $article + * @param string &$errorMsg + * @return true + */ public static function onProtectionSave( Page $article, &$errorMsg ) { global $wgUser, $wgRequest; if ( !$article->exists() ) { diff --git a/frontend/RevisionReviewFormUI.php b/frontend/RevisionReviewFormUI.php index 57bbcd8..05938df 100644 --- a/frontend/RevisionReviewFormUI.php +++ b/frontend/RevisionReviewFormUI.php @@ -245,7 +245,7 @@ return [ $form, true /* ok */ ]; } - /* + /** * If the REJECT button should show then get the ID of the last good rev * @return int */ diff --git a/frontend/specialpages/actions/Stabilization_body.php b/frontend/specialpages/actions/Stabilization_body.php index 4102bbb..b6cd863 100644 --- a/frontend/specialpages/actions/Stabilization_body.php +++ b/frontend/specialpages/actions/Stabilization_body.php @@ -328,7 +328,10 @@ } } - // If the this form is disabled, then return the "disabled" attr array + /** + * If the this form is disabled, then return the "disabled" attr array + * @return array + */ protected function disabledAttr() { return $this->form->isAllowed() ? [] diff --git a/frontend/specialpages/reports/ConfiguredPages_body.php b/frontend/specialpages/reports/ConfiguredPages_body.php index 532a9ea..5551084 100644 --- a/frontend/specialpages/reports/ConfiguredPages_body.php +++ b/frontend/specialpages/reports/ConfiguredPages_body.php @@ -118,7 +118,9 @@ class ConfiguredPagesPager extends AlphabeticPager { public $mForm, $mConds, $namespace, $override, $autoreview; - /* + /** + * @param SpecialPage $form + * @param array $conds * @param int $namespace (null for "all") * @param int $override (null for "either") * @param string $autoreview ('' for "all", 'none' for no restriction) diff --git a/frontend/specialpages/reports/PendingChanges_body.php b/frontend/specialpages/reports/PendingChanges_body.php index f621f89..b733325 100644 --- a/frontend/specialpages/reports/PendingChanges_body.php +++ b/frontend/specialpages/reports/PendingChanges_body.php @@ -137,7 +137,11 @@ } } - // set pager parameters from $par, return pager limit + /** + * Set pager parameters from $par, return pager limit + * @param string $par + * @return bool|int + */ protected function parseParams( $par ) { $bits = preg_split( '/\s*,\s*/', trim( $par ) ); $limit = false; diff --git a/frontend/specialpages/reports/ProblemChanges_body.php b/frontend/specialpages/reports/ProblemChanges_body.php index ed449b1..325b71b 100644 --- a/frontend/specialpages/reports/ProblemChanges_body.php +++ b/frontend/specialpages/reports/ProblemChanges_body.php @@ -108,7 +108,11 @@ } } - // set pager parameters from $par, return pager limit + /** + * Set pager parameters from $par, return pager limit + * @param string $par + * @return bool|int + */ protected function parseParams( $par ) { $bits = preg_split( '/\s*,\s*/', trim( $par ) ); $limit = false; diff --git a/frontend/specialpages/reports/StablePages_body.php b/frontend/specialpages/reports/StablePages_body.php index 48f48af..e417de9 100644 --- a/frontend/specialpages/reports/StablePages_body.php +++ b/frontend/specialpages/reports/StablePages_body.php @@ -121,7 +121,7 @@ * @param array $conds * @param int $namespace (null for "all") * @param string $autoreview ('' for "all", 'none' for no restriction) - * @param $indef + * @param string $indef */ function __construct( $form, $conds = [], $namespace, $autoreview, $indef ) { $this->mForm = $form; diff --git a/frontend/specialpages/reports/UnreviewedPages_body.php b/frontend/specialpages/reports/UnreviewedPages_body.php index 248887a..bfc53eb 100644 --- a/frontend/specialpages/reports/UnreviewedPages_body.php +++ b/frontend/specialpages/reports/UnreviewedPages_body.php @@ -175,6 +175,7 @@ /** * There may be many pages, most of which are reviewed + * @return bool */ public static function generalQueryOK() { $namespaces = FlaggedRevs::getReviewNamespaces(); @@ -193,7 +194,7 @@ return ( $ratio <= 400 ); } - /* + /** * Run an update to the cached query rows * @return void */ diff --git a/frontend/specialpages/reports/ValidationStatistics_body.php b/frontend/specialpages/reports/ValidationStatistics_body.php index 6f4500d..11d1df5 100644 --- a/frontend/specialpages/reports/ValidationStatistics_body.php +++ b/frontend/specialpages/reports/ValidationStatistics_body.php @@ -304,7 +304,10 @@ return $stats['statTimestamp']; } - // top X reviewers in the last Y hours + /** + * Get top X reviewers in the last Y hours + * @return array + */ protected function getTopReviewers() { global $wgFlaggedRevsStats; diff --git a/maintenance/cachePendingRevs.php b/maintenance/cachePendingRevs.php index 460689f..0091427 100644 --- a/maintenance/cachePendingRevs.php +++ b/maintenance/cachePendingRevs.php @@ -49,7 +49,7 @@ /** * Log the cache message - * @param $msg String The message to log + * @param string $msg The message to log */ private function cachePendingRevsLog( $msg ) { $this->output( wfTimestamp( TS_DB ) . " $msg\n" ); diff --git a/phpcs.xml b/phpcs.xml index 90e6b57..beff47f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,10 +4,6 @@ <exclude name="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed"/> <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> - <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" /> <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" /> -- To view, visit https://gerrit.wikimedia.org/r/384223 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26f0ec72f9bd8f31d86cf38c40dbe06103eb747a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits