jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/371000 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: Ieb4d82d3562ea459a3b1b7a100634a7437f276b4 --- M PageTriage.hooks.php M SpecialNewPagesFeed.php M api/ApiPageTriageList.php M api/ApiPageTriageTemplate.php M composer.json M includes/ArticleMetadata.php M includes/Notifications/PageTriageAddDeletionTagPresentationModel.php M includes/Notifications/PageTriageAddMaintenanceTagPresentationModel.php M includes/Notifications/PageTriageMarkAsReviewedPresentationModel.php M includes/Notifications/PageTriagePresentationModel.php M includes/PageTriage.php M includes/PageTriageExternalDeletionTagsOptions.php M includes/PageTriageExternalTagsOptions.php M includes/PageTriageUtil.php M phpcs.xml M tools/importNewPages.php 16 files changed, 153 insertions(+), 150 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php index 71a495a..9cdecdd 100644 --- a/PageTriage.hooks.php +++ b/PageTriage.hooks.php @@ -7,9 +7,9 @@ * main(article) namespace * * @see http://www.mediawiki.org/wiki/Manual:Hooks/SpecialMovepageAfterMove - * @param $movePage MovePageForm object - * @param $oldTitle Title old title object - * @param $newTitle Title new title object + * @param MovePageForm $movePage MovePageForm object + * @param Title &$oldTitle old title object + * @param Title &$newTitle new title object * @return bool */ public static function onSpecialMovepageAfterMove( $movePage, &$oldTitle, &$newTitle ) { @@ -59,10 +59,10 @@ * Note: Page will be automatically marked as triaged for users with autopatrol right * * @see http://www.mediawiki.org/wiki/Manual:Hooks/NewRevisionFromEditComplete - * @param $page WikiPage the WikiPage edited - * @param $rev Revision|null the new revision - * @param $baseID int the revision ID this was based on, if any - * @param $user User the editing user + * @param WikiPage $page the WikiPage edited + * @param Revision|null $rev the new revision + * @param int $baseID the revision ID this was based on, if any + * @param User $user the editing user * @return bool */ public static function onNewRevisionFromEditComplete( $page, $rev, $baseID, $user ) { @@ -90,15 +90,15 @@ * When a new article is created, insert it into the PageTriage Queue * * @see http://www.mediawiki.org/wiki/Manual:Hooks/ArticleInsertComplete - * @param $article WikiPage created - * @param $user User creating the article - * @param $content Content New content - * @param $summary string Edit summary/comment - * @param $isMinor bool Whether or not the edit was marked as minor - * @param $isWatch bool (No longer used) - * @param $section bool (No longer used) - * @param $flags: Flags passed to Article::doEdit() - * @param $revision Revision New Revision of the article + * @param WikiPage $article WikiPage created + * @param User $user User creating the article + * @param Content $content New content + * @param string $summary Edit summary/comment + * @param bool $isMinor Whether or not the edit was marked as minor + * @param bool $isWatch (No longer used) + * @param bool $section (No longer used) + * @param int $flags Flags passed to Article::doEdit() + * @param Revision $revision New Revision of the article * @return bool */ public static function onPageContentInsertComplete( @@ -118,17 +118,17 @@ * Flush user status cache on a successful save. * * @see http://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete - * @param $article WikiPage - * @param $user - * @param $content Content - * @param $summary - * @param $minoredit - * @param $watchthis - * @param $sectionanchor - * @param $flags - * @param $revision - * @param $status - * @param $baseRevId + * @param WikiPage $article + * @param User $user + * @param Content $content + * @param string $summary + * @param bool $minoredit + * @param bool $watchthis + * @param string $sectionanchor + * @param int $flags + * @param Revision $revision + * @param Status $status + * @param int $baseRevId * @return bool */ public static function onPageContentSaveComplete( @@ -144,7 +144,6 @@ * @param LinksUpdate $linksUpdate * @return bool */ - public static function onLinksUpdateComplete( LinksUpdate $linksUpdate ) { global $wgPageTriageNamespaces; if ( !in_array( $linksUpdate->getTitle()->getNamespace(), $wgPageTriageNamespaces ) ) { @@ -168,10 +167,11 @@ * Remove the metadata we added when the article is deleted. * * 'ArticleDeleteComplete': after an article is deleted - * @param $article WikiPage the WikiPage that was deleted - * @param $user User the user that deleted the article - * @param $reason string the reason the article was deleted - * @param $id int id of the article that was deleted + * @param WikiPage $article the WikiPage that was deleted + * @param User $user the user that deleted the article + * @param string $reason the reason the article was deleted + * @param int $id id of the article that was deleted + * @return true */ public static function onArticleDeleteComplete( $article, $user, $reason, $id ) { global $wgPageTriageNamespaces; @@ -193,10 +193,10 @@ * * This method should only be called from this class and its closures * - * @param $pageId int - * @param $title Title - * @param $user User|null - * @param $reviewed numeric string See PageTriage::getValidReviewedStatus() + * @param int $pageId + * @param Title $title + * @param User|null $user + * @param string $reviewed numeric string See PageTriage::getValidReviewedStatus() * @return bool */ public static function addToPageTriageQueue( $pageId, $title, $user = null, $reviewed = null ) { @@ -230,8 +230,8 @@ /** * Add last time user visited the triage page to preferences. - * @param $user User object - * @param &$preferences array Preferences object + * @param User $user User object + * @param array &$preferences array Preferences object * @return bool */ public static function onGetPreferences( $user, &$preferences ) { @@ -245,7 +245,7 @@ /** * Flush user page/user talk page exsitance status, this function should * be called when a page gets created/deleted/moved/restored - * @param $title + * @param Title $title */ private static function flushUserStatusCache( $title ) { global $wgMemc; @@ -269,7 +269,7 @@ * Note that we always check the age of the page last since that is * potentially the most expensive check (if the data isn't cached). * - * @param $article Article + * @param Article $article * @return bool */ private static function shouldShowNoIndex( $article ) { @@ -349,7 +349,7 @@ /** * Formats a template name to match the format returned by getTemplates() - * @param $template string + * @param string $template * @return string */ private static function formatTemplateName( $template ) { @@ -362,8 +362,8 @@ * Handler for hook ArticleViewFooter, this will determine whether to load * curation toolbar or 'mark as reviewed'/'reviewed' text * - * @param &$article Article object to show link for. - * @param $patrolFooterShown bool whether the patrol footer is shown + * @param Article $article Article object to show link for. + * @param bool $patrolFooterShown whether the patrol footer is shown * @return bool */ public static function onArticleViewFooter( $article, $patrolFooterShown ) { @@ -460,9 +460,9 @@ * $user: user (object) who marked the edit patrolled * $wcOnlySysopsCanPatrol: config setting indicating whether the user * must be a sysop to patrol the edit - * @param $rcid int - * @param $user User - * @param $wcOnlySysopsCanPatrol + * @param int $rcid + * @param User &$user + * @param bool $wcOnlySysopsCanPatrol * @return bool */ public static function onMarkPatrolledComplete( $rcid, &$user, $wcOnlySysopsCanPatrol ) { @@ -505,8 +505,8 @@ * Update Article metadata when a user gets blocked * * 'BlockIpComplete': after an IP address or user is blocked - * @param $block Block the Block object that was saved - * @param $performer User the user who did the block (not the one being blocked) + * @param Block $block the Block object that was saved + * @param User $performer the user who did the block (not the one being blocked) * @return bool */ public static function onBlockIpComplete( $block, $performer ) { @@ -517,7 +517,7 @@ /** * Send php config vars to js via ResourceLoader * - * @param &$vars: variables to be added to the output of the startup module + * @param array &$vars variables to be added to the output of the startup module * @return bool */ public static function onResourceLoaderGetConfigVars( &$vars ) { @@ -714,9 +714,9 @@ /** * Add PageTriage events to Echo * - * @param $notifications array a list of enabled echo events - * @param $notificationCategories array details for echo events - * @param $icons array of icon details + * @param array &$notifications array a list of enabled echo events + * @param array &$notificationCategories array details for echo events + * @param array &$icons array of icon details * @return bool */ public static function onBeforeCreateEchoEvent( @@ -761,8 +761,8 @@ /** * Add users to be notified on an echo event - * @param $event EchoEvent - * @param $users array + * @param EchoEvent $event + * @param array &$users * @return bool */ public static function onEchoGetDefaultNotifiedUsers( $event, &$users ) { @@ -795,8 +795,8 @@ /** * Handler for LocalUserCreated hook * @see http://www.mediawiki.org/wiki/Manual:Hooks/LocalUserCreated - * @param $user User object that was created. - * @param $autocreated bool True when account was auto-created + * @param User $user User object that was created. + * @param bool $autocreated True when account was auto-created * @return bool */ public static function onLocalUserCreated( $user, $autocreated ) { @@ -817,7 +817,7 @@ } /** - * @param $updater DatabaseUpdater + * @param DatabaseUpdater $updater * @return bool */ public static function onLoadExtensionSchemaUpdates( $updater = null ) { diff --git a/SpecialNewPagesFeed.php b/SpecialNewPagesFeed.php index c48230e..f82775e 100644 --- a/SpecialNewPagesFeed.php +++ b/SpecialNewPagesFeed.php @@ -20,7 +20,7 @@ /** * Define what happens when the special page is loaded by the user. - * @param $sub string The subpage, if any + * @param string $sub The subpage, if any */ public function execute( $sub ) { global $wgPageTriageInfiniteScrolling, @@ -300,7 +300,7 @@ /** * Helper function to convert booleans to strings (for passing to mw.config) - * @param boolean $value The value to convert into a string + * @param bool $value The value to convert into a string * @return bool|string */ private function booleanToString( $value ) { diff --git a/api/ApiPageTriageList.php b/api/ApiPageTriageList.php index bc27978..b874870 100644 --- a/api/ApiPageTriageList.php +++ b/api/ApiPageTriageList.php @@ -74,9 +74,9 @@ /** * Create user info like user page, user talk page, user contribution page - * @param $userName string a valid username - * @param $userPageStatus array an array of user page, user talk page existing status - * @param $prefix string array key prefix + * @param string $userName a valid username + * @param array $userPageStatus an array of user page, user talk page existing status + * @param string $prefix array key prefix * @return array */ private function createUserInfo( $userName, $userPageStatus, $prefix ) { @@ -98,8 +98,8 @@ /** * Return all the page ids in PageTraige matching the specified filters - * @param $opts array Array of filtering options - * @param $count boolean Set to true to return a count instead + * @param array $opts Array of filtering options + * @param bool $count Set to true to return a count instead * @return array|int an array of ids or total number of pages * * @todo - enforce a range of timestamp to reduce tag record scan @@ -224,7 +224,7 @@ } /** - * @param $opts array + * @param array $opts * @return string */ private static function buildTagQuery( $opts ) { @@ -327,6 +327,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { return [ diff --git a/api/ApiPageTriageTemplate.php b/api/ApiPageTriageTemplate.php index ca95899..b7b0c77 100644 --- a/api/ApiPageTriageTemplate.php +++ b/api/ApiPageTriageTemplate.php @@ -68,6 +68,7 @@ /** * @see ApiBase::getExamplesMessages() + * @return array */ protected function getExamplesMessages() { return [ diff --git a/composer.json b/composer.json index 55507be..91c6304 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ }, "scripts": { "test": [ - "parallel-lint . --exclude vendor", + "parallel-lint . --exclude vendor --exclude node_modules", "phpcs -p -s" ], "fix": [ diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php index 0b729ca..5356849 100755 --- a/includes/ArticleMetadata.php +++ b/includes/ArticleMetadata.php @@ -8,9 +8,9 @@ protected $mPageId; /** - * @param $pageId array - list of page id - * @param $validated bool - whether the page ids have been validated - * @param $validateDb const - DB_MASTER/DB_SLAVE + * @param array $pageId list of page id + * @param bool $validated whether the page ids have been validated + * @param int $validateDb const DB_MASTER/DB_SLAVE */ public function __construct( array $pageId, $validated = true, $validateDb = DB_MASTER ) { if ( $validated ) { @@ -23,7 +23,7 @@ /** * Delete all the metadata for an article * - * @param $pageId - the page id to be deleted + * @return bool */ public function deleteMetadata() { if ( $this->mPageId ) { @@ -43,8 +43,8 @@ /** * Flush the metadata in cache - * @param $pageId - page id to be flushed, if null is provided, all - * page id in $this->mPageId will be flushed + * @param int $pageId page id to be flushed, if null is provided, all + * page id in $this->mPageId will be flushed */ public function flushMetadataFromCache( $pageId = null ) { $cache = ObjectCache::getMainWANInstance(); @@ -61,8 +61,8 @@ /** * Set the metadata to cache - * @param $pageId int - page id - * @param $singleData mixed - data to be saved + * @param int $pageId page id + * @param mixed $singleData data to be saved */ public function setMetadataToCache( $pageId, $singleData ) { $cache = ObjectCache::getMainWANInstance(); @@ -72,8 +72,8 @@ /** * Get the metadata from cache - * @param $pageId - the page id to get the cache data for, if null is provided - * all page id in $this->mPageId will be obtained + * @param int $pageId the page id to get the cache data for, if null is provided + * all page id in $this->mPageId will be obtained * @return array */ public function getMetadataFromCache( $pageId = null ) { @@ -240,8 +240,8 @@ /** * Typecast the value in page id array to int and verify that it's * in page triage queue - * @param $pageIds array - * @param $validateDb const DB_MASTER/DB_SLAVE + * @param array $pageIds + * @param int $validateDb const DB_MASTER/DB_SLAVE * @return array */ public static function validatePageId( array $pageIds, $validateDb = DB_MASTER ) { @@ -303,7 +303,7 @@ const SAVE_DEFERRED = 1; /** - * @param $pageId array - list of page id + * @param array $pageId list of page id */ private function __construct( $pageId ) { $this->mPageId = $pageId; @@ -328,9 +328,9 @@ /** * Factory for creating an instance - * @param $pageId array - * @param $validated bool - whether page ids are validated - * @param $validateDb const - DB_MASTER/DB_SLAVE + * @param array $pageId + * @param bool $validated whether page ids are validated + * @param int $validateDb const DB_MASTER/DB_SLAVE * @return ArticleCompileProcessor|false */ public static function newFromPageId( array $pageId, $validated = true, $validateDb = DB_MASTER ) { @@ -346,7 +346,7 @@ /** * Cache an up-to-date WikiPage object for later use - * @param $article - Article + * @param WikiPage $article */ public function registerArticle( WikiPage $article ) { if ( in_array( $article->getId(), $this->mPageId ) ) { @@ -363,7 +363,7 @@ /** * Register a component to the processor for compiling - * @param $component string + * @param string $component */ public function registerComponent( $component ) { if ( isset( $this->component[$component] ) ) { @@ -374,7 +374,7 @@ /** * Config what db to use for each component - * @param $config array + * @param array $config * example: array( 'BasicData' => DB_SLAVE, 'UserData' => DB_MASTER ) */ public function configComponentDb( $config ) { @@ -388,7 +388,7 @@ /** * Wrapper function for compiling the data - * @param integer $mode Class SAVE_* constant + * @param int $mode Class SAVE_* constant * @return array */ public function compileMetadata( $mode = self::SAVE_IMMEDIATE ) { @@ -545,7 +545,10 @@ protected $componentDb; /** - * @param $pageId array + * @param array $pageId + * @param int $componentDb + * @param array $articles + * @param array $linksUpdates */ public function __construct( array $pageId, $componentDb = DB_MASTER, $articles = null, $linksUpdates = null @@ -572,11 +575,11 @@ /** * Provide an edtimated count for an item, for example: if $maxNumToProcess is * 100 and the result is greater than 100, then the result should be 100+ - * @param $pageId int - page id - * @param $table array - table for query - * @param $conds array - conditions for query - * @param $maxNumProcess int - max number to process/display - * @param $indexName string - the array index name to be saved + * @param int $pageId page id + * @param array $table table for query + * @param array $conds conditions for query + * @param int $maxNumToProcess max number to process/display + * @param string $indexName the array index name to be saved */ protected function processEstimatedCount( $pageId, $table, $conds, $maxNumToProcess, $indexName ) { $res = $this->db->select( @@ -597,7 +600,7 @@ /** * Fill in zero for page with no estimated count - * @param $indexName string - the array index name for the count + * @param string $indexName the array index name for the count */ protected function fillInZeroCount( $indexName ) { foreach ( $this->mPageId as $pageId ) { @@ -802,7 +805,7 @@ /** * Generate article snippet for listview from article text - * @param $text string - page text + * @param string $text page text * @return string */ public static function generateArticleSnippet( $text ) { @@ -842,6 +845,8 @@ /** * Check if a page has reference, this just checks <ref> and </ref> tags * this is sufficient since we just want to get an estimate + * @param string $text + * @return string */ public static function checkReferenceTag( $text ) { $closeTag = strpos( $text, '</ref>' ); diff --git a/includes/Notifications/PageTriageAddDeletionTagPresentationModel.php b/includes/Notifications/PageTriageAddDeletionTagPresentationModel.php index edfaf11..70edef9 100644 --- a/includes/Notifications/PageTriageAddDeletionTagPresentationModel.php +++ b/includes/Notifications/PageTriageAddDeletionTagPresentationModel.php @@ -2,14 +2,14 @@ class PageTriageAddDeletionTagPresentationModel extends PageTriagePresentationModel { /** - * {@inheritdoc} + * @inheritDoc */ public function getIconType() { return 'trash'; } /** - * {@inheritdoc} + * @inheritDoc */ public function getSecondaryLinks() { $links = [ $this->getAgentLink() ]; @@ -21,7 +21,7 @@ } /** - * {@inheritdoc} + * @inheritDoc */ public function getHeaderMessage() { $msg = parent::getHeaderMessage(); diff --git a/includes/Notifications/PageTriageAddMaintenanceTagPresentationModel.php b/includes/Notifications/PageTriageAddMaintenanceTagPresentationModel.php index 8f472b5..2ea70d7 100644 --- a/includes/Notifications/PageTriageAddMaintenanceTagPresentationModel.php +++ b/includes/Notifications/PageTriageAddMaintenanceTagPresentationModel.php @@ -2,14 +2,14 @@ class PageTriageAddMaintenanceTagPresentationModel extends PageTriagePresentationModel { /** - * {@inheritdoc} + * @inheritDoc */ public function getIconType() { return 'reviewed'; } /** - * {@inheritdoc} + * @inheritDoc */ public function getSecondaryLinks() { $links = [ $this->getAgentLink() ]; @@ -21,7 +21,7 @@ } /** - * {@inheritdoc} + * @inheritDoc */ public function getHeaderMessage() { $msg = parent::getHeaderMessage(); diff --git a/includes/Notifications/PageTriageMarkAsReviewedPresentationModel.php b/includes/Notifications/PageTriageMarkAsReviewedPresentationModel.php index 8b61c78..2ab8911 100644 --- a/includes/Notifications/PageTriageMarkAsReviewedPresentationModel.php +++ b/includes/Notifications/PageTriageMarkAsReviewedPresentationModel.php @@ -3,21 +3,21 @@ class PageTriageMarkAsReviewedPresentationModel extends PageTriagePresentationModel { /** - * {@inheritdoc} + * @inheritDoc */ public function getIconType() { return 'reviewed'; } /** - * {@inheritdoc} + * @inheritDoc */ public function getSecondaryLinks() { return [ $this->getAgentLink() ]; } /** - * {@inheritdoc} + * @inheritDoc */ public function getHeaderMessage() { $msg = parent::getHeaderMessage(); diff --git a/includes/Notifications/PageTriagePresentationModel.php b/includes/Notifications/PageTriagePresentationModel.php index d34a0a0..7a310f5 100644 --- a/includes/Notifications/PageTriagePresentationModel.php +++ b/includes/Notifications/PageTriagePresentationModel.php @@ -2,14 +2,14 @@ abstract class PageTriagePresentationModel extends EchoEventPresentationModel { /** - * {@inheritdoc} + * @inheritDoc */ public function canRender() { return $this->event->getTitle() instanceof Title; } /** - * {@inheritdoc} + * @inheritDoc */ public function getPrimaryLink() { return [ diff --git a/includes/PageTriage.php b/includes/PageTriage.php index 76c5794..267e16d 100755 --- a/includes/PageTriage.php +++ b/includes/PageTriage.php @@ -20,7 +20,7 @@ protected $mArticleMetadata; /** - * @param $pageId int + * @param int $pageId */ public function __construct( $pageId ) { $this->mPageId = (int)$pageId; @@ -29,13 +29,13 @@ /** * Add page to page triage queue - * @param $reviewed string The reviewed status of the page... + * @param string $reviewed The reviewed status of the page... * '0': unreviewed * '1': reviewed manually * '2': patrolled from Special:NewPages * '3': auto-patrolled - * @param $user User - * @param $fromRc bool + * @param User $user + * @param bool $fromRc * @throws MWPageTriageMissingRevisionException * @return bool - true: add new record, false: update existing record */ @@ -88,9 +88,9 @@ /** * set the triage status of an article in pagetriage queue - * @param $reviewed string - see PageTriage::getValidReviewedStatus() - * @param $user User - * @param $fromRc bool + * @param string $reviewed see PageTriage::getValidReviewedStatus() + * @param User $user + * @param bool $fromRc */ public function setTriageStatus( $reviewed, User $user = null, $fromRc = false ) { if ( !array_key_exists( $reviewed, self::getValidReviewedStatus() ) ) { @@ -140,10 +140,10 @@ /** * Update the database record - * @param $row array key => value pair to be updated + * @param array $row key => value pair to be updated * Todo: ptrpt_reviewed should not updated from this function, add exception to catch this * or find a better solution - */ + */ public function update( $row ) { if ( !$row ) { return; @@ -253,7 +253,7 @@ /** * Set the tags updated timestamp - * @param $pageIds array + * @param array $pageIds * @return string */ public static function bulkSetTagsUpdated( $pageIds ) { diff --git a/includes/PageTriageExternalDeletionTagsOptions.php b/includes/PageTriageExternalDeletionTagsOptions.php index b0b11ea..996123e 100644 --- a/includes/PageTriageExternalDeletionTagsOptions.php +++ b/includes/PageTriageExternalDeletionTagsOptions.php @@ -5,7 +5,7 @@ class PageTriageExternalDeletionTagsOptions extends ResourceLoaderWikiModule { /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ protected function getPages( ResourceLoaderContext $context ) { @@ -15,7 +15,7 @@ } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/includes/PageTriageExternalTagsOptions.php b/includes/PageTriageExternalTagsOptions.php index e4d67f8..339c06e 100644 --- a/includes/PageTriageExternalTagsOptions.php +++ b/includes/PageTriageExternalTagsOptions.php @@ -5,7 +5,7 @@ class PageTriageExternalTagsOptions extends ResourceLoaderWikiModule { /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ protected function getPages( ResourceLoaderContext $context ) { @@ -15,7 +15,7 @@ } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/includes/PageTriageUtil.php b/includes/PageTriageUtil.php index 29d1539..da67e22 100755 --- a/includes/PageTriageUtil.php +++ b/includes/PageTriageUtil.php @@ -8,7 +8,7 @@ /** * Get whether or not a page needs triaging * - * @param $article WikiPage object + * @param WikiPage $article WikiPage object * * @throws Exception * @return Mixed null if the page is not in the triage system, @@ -54,7 +54,7 @@ /** * Get a list of stat for unreviewed articles - * @param $namespace int + * @param int $namespace * @return array * * @Todo - Limit the number of records by a timestamp filter, maybe 30 days etc, @@ -173,8 +173,8 @@ /** * Get top page triagers in various time frame - * @param $time string - time to look back for top triagers, possible values include - * last-day, last-week, last-month + * @param string $time time to look back for top triagers, possible values include + * last-day, last-week, last-month * @return array */ public static function getTopTriagers( $time = 'last-week' ) { @@ -220,7 +220,7 @@ /** * returns the cache key for user status - * @param $userName string + * @param string $userName * @return string */ public static function userStatusKey( $userName ) { @@ -229,7 +229,7 @@ /** * Check the existance of user page and talk page for a list of users - * @param $users array - contains user_name db keys + * @param array $users contains user_name db keys * @return array */ public static function pageStatusForUser( $users ) { @@ -318,8 +318,8 @@ /** * Update user metadata when a user's block status is updated - * @param $block Block - Block object - * @param $status int 1/0 + * @param Block $block Block object + * @param int $status 1/0 */ public static function updateMetadataOnBlockChange( $block, $status = 1 ) { // do instant update if the number of page to be updated is less or equal to @@ -380,10 +380,10 @@ * 3. 'Add maintenance tag' curation flyout * 4. 'Add deletion tag' curation flyout * - * @param $article Article - * @param $user User - * @param $type string notification type - * @param $extra array/null + * @param Article $article + * @param User $user + * @param string $type notification type + * @param array|null $extra */ public static function createNotificationEvent( $article, $user, $type, $extra = null ) { if ( !class_exists( 'EchoEvent' ) ) { diff --git a/phpcs.xml b/phpcs.xml index 48d5b68..2596b17 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,10 +2,6 @@ <ruleset> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <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.SpacingAfter" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> @@ -14,5 +10,4 @@ <file>.</file> <arg name="extensions" value="php,php5,inc" /> <arg name="encoding" value="UTF-8" /> - <exclude-pattern>vendor</exclude-pattern> </ruleset> diff --git a/tools/importNewPages.php b/tools/importNewPages.php index 21401ea..7d2f920 100644 --- a/tools/importNewPages.php +++ b/tools/importNewPages.php @@ -30,7 +30,8 @@ } /** - * @param $url string + * @param string $url + * @return mixed */ function get( $url ) { curl_setopt( $this->curlHandle, CURLOPT_URL, $url ); @@ -47,8 +48,8 @@ } /** - * @param $url string - * @param $postVars + * @param string $url + * @param array $postVars * @return mixed */ function post( $url, $postVars ) { @@ -83,7 +84,7 @@ /** * Construct the class instance - * @param $url string The URL used to access the API + * @param string $url The URL used to access the API **/ function __construct( $url ) { $this->http = new PageTriageHttp; @@ -92,7 +93,7 @@ /** * Send a get query to the API - * @param $query string y The query string + * @param string $query The query string * @return string The result from the API **/ function get( $query ) { @@ -102,8 +103,8 @@ /** * Send a post query to the API - * @param $query string The query string - * @param $postVars + * @param string $query The query string + * @param array $postVars * @return string The result from the API */ function post( $query, $postVars ) { @@ -113,8 +114,8 @@ /** * Log into the wiki via the API - * @param $username string The user's username - * @param $password string The user's password + * @param string $username The user's username + * @param string $password The user's password * @return string The result from the API **/ function login( $username, $password ) { @@ -154,7 +155,7 @@ /** * Get the contents of a page - * @param $title string The title of the wikipedia page to fetch + * @param string $title The title of the wikipedia page to fetch * @return string|bool The wikitext for the page (or false) **/ function getPage( $title ) { @@ -180,8 +181,8 @@ /** * Get the newest pages from the wiki - * @param $namespace int The namespace to limit the search to - * @param $limit int The maximum number of pages to return + * @param int $namespace The namespace to limit the search to + * @param int $limit The maximum number of pages to return * @return array of titles **/ function getNewPages( $namespace = 0, $limit = 10 ) { @@ -206,8 +207,8 @@ /** * Create a new page on the wiki - * @param $title string The title of the new page - * @param $text string The text of the new page + * @param string $title The title of the new page + * @param string $text The text of the new page * @return string The result from the API **/ function createPage( $title, $text ) { -- To view, visit https://gerrit.wikimedia.org/r/371000 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb4d82d3562ea459a3b1b7a100634a7437f276b4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits