jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370827 )

Change subject: Improve some parameter docs
......................................................................


Improve some parameter docs

Change-Id: Ib1aa0db1aa061f0ef442322d38958fa7e03a34ac
---
M composer.json
M includes/ApiQueryGlobalUsage.php
M includes/GlobalUsage.php
M includes/GlobalUsageHooks.php
M includes/GlobalUsageImagePageHooks.php
M includes/GlobalUsageQuery.php
M includes/SpecialGlobalUsage.php
M includes/SpecialGloballyWantedFiles.php
M includes/SpecialMostGloballyLinkedFiles.php
M phpcs.xml
10 files changed, 57 insertions(+), 57 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/composer.json b/composer.json
index bf202bf..fd295f4 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
        "scripts": {
                "fix": "phpcbf",
                "test": [
-                       "parallel-lint . --exclude vendor",
+                       "parallel-lint . --exclude vendor --exclude 
node_modules",
                        "phpcs -p -s"
                ]
        }
diff --git a/includes/ApiQueryGlobalUsage.php b/includes/ApiQueryGlobalUsage.php
index c3cbcea..a33d7c5 100644
--- a/includes/ApiQueryGlobalUsage.php
+++ b/includes/ApiQueryGlobalUsage.php
@@ -134,6 +134,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/includes/GlobalUsage.php b/includes/GlobalUsage.php
index 51bbd39..353a65f 100644
--- a/includes/GlobalUsage.php
+++ b/includes/GlobalUsage.php
@@ -13,8 +13,8 @@
        /**
         * Construct a GlobalUsage instance for a certain wiki.
         *
-        * @param $interwiki string Interwiki prefix of the wiki
-        * @param $db IDatabase Database object
+        * @param string $interwiki Interwiki prefix of the wiki
+        * @param IDatabase $db Database object
         */
        public function __construct( $interwiki, IDatabase $db ) {
                $this->interwiki = $interwiki;
@@ -24,10 +24,10 @@
        /**
         * Sets the images used by a certain page
         *
-        * @param $title Title Title of the page
-        * @param $images array Array of db keys of images used
-        * @param $pageIdFlags int
-        * @param $ticket int|null
+        * @param Title $title Title of the page
+        * @param array $images Array of db keys of images used
+        * @param int $pageIdFlags
+        * @param int|null $ticket
         */
        public function insertLinks(
                Title $title, array $images, $pageIdFlags = 
Title::GAID_FOR_UPDATE, $ticket = null
@@ -56,7 +56,7 @@
 
        /**
         * Get all global images from a certain page
-        * @param $id int
+        * @param int $id
         * @return array
         */
        public function getLinksFromPage( $id ) {
@@ -81,9 +81,9 @@
        /**
         * Deletes all entries from a certain page to certain files
         *
-        * @param $id int Page id of the page
-        * @param $to mixed File name(s)
-        * @param $ticket int|null
+        * @param int $id Page id of the page
+        * @param mixed $to File name(s)
+        * @param int|null $ticket
         */
        public function deleteLinksFromPage( $id, array $to = null, $ticket = 
null ) {
                global $wgUpdateRowsPerQuery;
@@ -108,7 +108,7 @@
        /**
         * Deletes all entries to a certain image
         *
-        * @param $title Title Title of the file
+        * @param Title $title Title of the file
         */
        public function deleteLinksToFile( $title ) {
                $this->db->delete(
@@ -124,7 +124,7 @@
        /**
         * Copy local links to global table
         *
-        * @param $title Title Title of the file to copy entries from.
+        * @param Title $title Title of the file to copy entries from.
         */
        public function copyLocalImagelinks( Title $title ) {
                global $wgContLang;
@@ -157,8 +157,8 @@
        /**
         * Changes the page title
         *
-        * @param $id int Page id of the page
-        * @param $title Title New title of the page
+        * @param int $id Page id of the page
+        * @param Title $title New title of the page
         */
        public function moveTo( $id, $title ) {
                $this->db->update(
@@ -287,7 +287,7 @@
        }
 
        /**
-        * @param integer $index DB_MASTER/DB_REPLICA
+        * @param int $index DB_MASTER/DB_REPLICA
         * @param array $groups
         * @return IDatabase
         */
diff --git a/includes/GlobalUsageHooks.php b/includes/GlobalUsageHooks.php
index 4cf50e9..1f02706 100644
--- a/includes/GlobalUsageHooks.php
+++ b/includes/GlobalUsageHooks.php
@@ -9,7 +9,7 @@
        /**
         * Hook to LinksUpdateComplete
         * Deletes old links from usage table and insert new ones.
-        * @param $linksUpdater LinksUpdate
+        * @param LinksUpdate $linksUpdater
         * @param int|null $ticket
         * @return bool
         */
@@ -53,11 +53,11 @@
         * Hook to TitleMoveComplete
         * Sets the page title in usage table to the new name.
         * For shared file moves, purges all pages in the wiki farm that use 
the files.
-        * @param $ot Title
-        * @param $nt Title
-        * @param $user User
-        * @param $pageid int
-        * @param $redirid
+        * @param Title $ot
+        * @param Title $nt
+        * @param User $user
+        * @param int $pageid
+        * @param int $redirid
         * @return bool
         */
        public static function onTitleMoveComplete( $ot, $nt, $user, $pageid, 
$redirid ) {
@@ -84,10 +84,10 @@
        /**
         * Hook to ArticleDeleteComplete
         * Deletes entries from usage table.
-        * @param $article Article
-        * @param $user User
-        * @param $reason string
-        * @param $id int
+        * @param Article $article
+        * @param User $user
+        * @param string $reason
+        * @param int $id
         * @return bool
         */
        public static function onArticleDeleteComplete( $article, $user, 
$reason, $id ) {
@@ -102,11 +102,11 @@
         * Hook to FileDeleteComplete
         * Copies the local link table to the global.
         * Purges all pages in the wiki farm that use the file if it is a 
shared repo file.
-        * @param $file File
-        * @param $oldimage
-        * @param $article Article
-        * @param $user User
-        * @param $reason string
+        * @param File $file
+        * @param File $oldimage
+        * @param Article $article
+        * @param User $user
+        * @param string $reason
         * @return bool
         */
        public static function onFileDeleteComplete( $file, $oldimage, 
$article, $user, $reason ) {
@@ -127,10 +127,10 @@
         * Hook to FileUndeleteComplete
         * Deletes the file from the global link table.
         * Purges all pages in the wiki farm that use the file if it is a 
shared repo file.
-        * @param $title Title
-        * @param $versions
-        * @param $user User
-        * @param $reason string
+        * @param Title $title
+        * @param array $versions
+        * @param User $user
+        * @param string $reason
         * @return bool
         */
        public static function onFileUndeleteComplete( $title, $versions, 
$user, $reason ) {
@@ -149,7 +149,7 @@
         * Hook to UploadComplete
         * Deletes the file from the global link table.
         * Purges all pages in the wiki farm that use the file if it is a 
shared repo file.
-        * @param $upload File
+        * @param File $upload
         * @return bool
         */
        public static function onUploadComplete( $upload ) {
@@ -187,7 +187,7 @@
 
        /**
         * Hook to make sure globalimagelinks table gets duplicated for 
parsertests
-        * @param $tables array
+        * @param array &$tables
         * @return bool
         */
        public static function onParserTestTables( &$tables ) {
@@ -198,7 +198,7 @@
        /**
         * Hook to apply schema changes
         *
-        * @param $updater DatabaseUpdater
+        * @param DatabaseUpdater $updater
         * @return bool
         */
        public static function onLoadExtensionSchemaUpdates( $updater = null ) {
diff --git a/includes/GlobalUsageImagePageHooks.php 
b/includes/GlobalUsageImagePageHooks.php
index 9ba97f6..8536d97 100644
--- a/includes/GlobalUsageImagePageHooks.php
+++ b/includes/GlobalUsageImagePageHooks.php
@@ -30,8 +30,8 @@
        /**
         * Show a global usage section on the image page
         *
-        * @param $imagePage ImagePage
-        * @param string $html HTML to add to the image page as global usage 
section
+        * @param ImagePage $imagePage
+        * @param string &$html HTML to add to the image page as global usage 
section
         * @return bool
         */
        public static function onImagePageAfterImageLinks( $imagePage, &$html ) 
{
@@ -74,8 +74,8 @@
 
        /**
         * Show a link to the global image links in the TOC if there are any 
results available.
-        * @param $imagePage ImagePage
-        * @param $toc array
+        * @param ImagePage $imagePage
+        * @param array &$toc
         * @return bool
         */
        public static function onImagePageShowTOC( $imagePage, &$toc ) {
@@ -91,7 +91,7 @@
         * Check whether there are results for an image page. Checks whether the
         * file exists and is not local.
         *
-        * @param $imagePage ImagePage
+        * @param ImagePage $imagePage
         * @return bool
         */
        protected static function hasResults( $imagePage ) {
diff --git a/includes/GlobalUsageQuery.php b/includes/GlobalUsageQuery.php
index 8069c6d..a208eac 100644
--- a/includes/GlobalUsageQuery.php
+++ b/includes/GlobalUsageQuery.php
@@ -19,7 +19,7 @@
        private $lastRow;
 
        /**
-        * @param $target mixed Title or array of db keys of target(s).
+        * @param mixed $target Title or array of db keys of target(s).
         * If a title, can be a category or a file
         */
        public function __construct( $target ) {
@@ -38,8 +38,8 @@
        /**
         * Set the offset parameter
         *
-        * @param $offset string offset
-        * @param $reversed bool True if this is the upper offset
+        * @param string $offset offset
+        * @param bool $reversed True if this is the upper offset
         * @return bool
         */
        public function setOffset( $offset, $reversed = null ) {
@@ -94,7 +94,7 @@
        /**
         * Set the maximum amount of items to return. Capped at 500.
         *
-        * @param $limit int The limit
+        * @param int $limit The limit
         */
        public function setLimit( $limit ) {
                $this->limit = min( $limit, 500 );
@@ -110,7 +110,7 @@
 
        /**
         * Set whether to filter out the local usage
-        * @param $value bool
+        * @param bool $value
         */
        public function filterLocal( $value = true ) {
                $this->filterLocal = $value;
diff --git a/includes/SpecialGlobalUsage.php b/includes/SpecialGlobalUsage.php
index 1942cde..da2236f 100644
--- a/includes/SpecialGlobalUsage.php
+++ b/includes/SpecialGlobalUsage.php
@@ -21,7 +21,7 @@
 
        /**
         * Entry point
-        * @param $par String
+        * @param string $par
         */
        public function execute( $par ) {
                $target = $par ? $par : $this->getRequest()->getVal( 'target' );
@@ -191,7 +191,7 @@
 
        /**
         * Helper to format a specific item
-        * @param $item array
+        * @param array $item
         * @return String
         */
        public static function formatItem( $item ) {
@@ -210,7 +210,7 @@
        /**
         * Helper function to create the navbar, stolen from wfViewPrevNext
         *
-        * @param $query GlobalUsageQuery An executed GlobalUsageQuery object
+        * @param GlobalUsageQuery $query An executed GlobalUsageQuery object
         * @return string Navbar HTML
         */
        protected function getNavBar( $query ) {
diff --git a/includes/SpecialGloballyWantedFiles.php 
b/includes/SpecialGloballyWantedFiles.php
index 4e5620c..e64688c 100644
--- a/includes/SpecialGloballyWantedFiles.php
+++ b/includes/SpecialGloballyWantedFiles.php
@@ -16,6 +16,7 @@
        /**
         * Main execution function. Use the parent if we're on the right wiki.
         * If we're not on a shared repo, try to redirect there.
+        * @param string $par
         */
        function execute( $par ) {
                if ( GlobalUsage::onSharedRepo() ) {
@@ -73,8 +74,8 @@
         * We need to override this in order to link to Special:GlobalUsage
         * instead of Special:WhatLinksHere.
         *
-        * @param $skin Skin
-        * @param $result stdClass A row from the database
+        * @param Skin $skin
+        * @param stdClass $result A row from the database
         * @return String HTML to output
         */
        public function formatResult( $skin, $result ) {
diff --git a/includes/SpecialMostGloballyLinkedFiles.php 
b/includes/SpecialMostGloballyLinkedFiles.php
index 432c24f..c933eee 100644
--- a/includes/SpecialMostGloballyLinkedFiles.php
+++ b/includes/SpecialMostGloballyLinkedFiles.php
@@ -16,6 +16,7 @@
        /**
         * Main execution function. Use the parent if we're on the right wiki.
         * If we're not on a shared repo, try to redirect there.
+        * @param string $par
         */
        function execute( $par ) {
                if ( GlobalUsage::onSharedRepo() ) {
@@ -80,6 +81,7 @@
         * In most common configs (including WMF's), this wouldn't be needed. 
However
         * for completeness support having the shared repo db be separate from 
the
         * globalimagelinks db.
+        * @return IDatabase
         */
        function getRecacheDB() {
                global $wgGlobalUsageDatabase;
diff --git a/phpcs.xml b/phpcs.xml
index e8a6782..21b2bef 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.ParamNameNoMatch" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />

-- 
To view, visit https://gerrit.wikimedia.org/r/370827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1aa0db1aa061f0ef442322d38958fa7e03a34ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUsage
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

Reply via email to