Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370961 )

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

Improve some parameter docs

Change-Id: I4533c509b893790b05420d1b9132f3de7297c3e9
---
M backend/MWOAuth.hooks.php
M backend/MWOAuthConsumer.php
M backend/MWOAuthConsumerAcceptance.php
M backend/MWOAuthDAO.php
M backend/MWOAuthServer.php
M backend/MWOAuthSignatureMethod.php
M backend/MWOAuthUtils.php
M control/MWOAuthSubmitControl.php
M phpcs.xml
9 files changed, 32 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/61/370961/1

diff --git a/backend/MWOAuth.hooks.php b/backend/MWOAuth.hooks.php
index fb23e61..e558571 100644
--- a/backend/MWOAuth.hooks.php
+++ b/backend/MWOAuth.hooks.php
@@ -93,7 +93,7 @@
         * flooding Special:Tags with tags for consumers that will never be 
making
         * logged actions.
         *
-        * @param boolean $activeOnly true for ChangeTagsListActive, false for 
ListDefinedTags
+        * @param bool $activeOnly true for ChangeTagsListActive, false for 
ListDefinedTags
         * @param array &$tags
         * @return bool
         */
diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php
index afc3e0d..98ae243 100644
--- a/backend/MWOAuthConsumer.php
+++ b/backend/MWOAuthConsumer.php
@@ -32,13 +32,13 @@
                'authonlyprivate' => 'mwoauth-authonlyprivate',
        ];
 
-       /** @var integer Unique ID */
+       /** @var int Unique ID */
        protected $id;
        /** @var string Hex token */
        protected $consumerKey;
        /** @var string Name of connected application */
        protected $name;
-       /** @var integer Publisher's central user ID. $wgMWOAuthSharedUserIDs 
defines which central ID
+       /** @var int Publisher's central user ID. $wgMWOAuthSharedUserIDs 
defines which central ID
         *    provider to use. */
        protected $userId;
        /** @var string Version used for handshake breaking changes */
@@ -72,11 +72,11 @@
        protected $grants;
        /** @var \\MWRestrictions IP restrictions */
        protected $restrictions;
-       /** @var integer MWOAuthConsumer::STAGE_* constant */
+       /** @var int MWOAuthConsumer::STAGE_* constant */
        protected $stage;
        /** @var string TS_MW timestamp of last stage change */
        protected $stageTimestamp;
-       /** @var integer Indicates (if non-zero) this consumer's information is 
suppressed */
+       /** @var int Indicates (if non-zero) this consumer's information is 
suppressed */
        protected $deleted;
 
        /* Stages that registered consumer takes (stored in DB) */
@@ -160,7 +160,7 @@
        /**
         * @param \DBConnRef $db
         * @param string $key
-        * @param integer $flags MWOAuthConsumer::READ_* bitfield
+        * @param int $flags MWOAuthConsumer::READ_* bitfield
         * @return MWOAuthConsumer|bool
         */
        public static function newFromKey( \DBConnRef $db, $key, $flags = 0 ) {
@@ -184,8 +184,8 @@
         * @param \DBConnRef $db
         * @param string $name
         * @param string $version
-        * @param integer $userId Central user ID
-        * @param integer $flags MWOAuthConsumer::READ_* bitfield
+        * @param int $userId Central user ID
+        * @param int $flags MWOAuthConsumer::READ_* bitfield
         * @return MWOAuthConsumer|bool
         */
        public static function newFromNameVersionUser(
@@ -322,6 +322,8 @@
         * Magic method so that $consumer->secret and $consumer->key work.
         * This allows MWOAuthConsumer to be a replacement for OAuthConsumer
         * in lib/OAuth.php without inheriting.
+        * @param mixed $prop
+        * @return mixed
         */
        public function __get( $prop ) {
                if ( $prop === 'key' ) {
diff --git a/backend/MWOAuthConsumerAcceptance.php 
b/backend/MWOAuthConsumerAcceptance.php
index b5c71fa..27969ec 100644
--- a/backend/MWOAuthConsumerAcceptance.php
+++ b/backend/MWOAuthConsumerAcceptance.php
@@ -25,13 +25,13 @@
  * Representation of an OAuth consumer acceptance
  */
 class MWOAuthConsumerAcceptance extends MWOAuthDAO {
-       /** @var integer Unique ID */
+       /** @var int Unique ID */
        protected $id;
        /** @var string Wiki ID the application can be used on (or "*" for all) 
*/
        protected $wiki;
-       /** @var integer Publisher user ID (on central wiki) */
+       /** @var int Publisher user ID (on central wiki) */
        protected $userId;
-       /** @var integer */
+       /** @var int */
        protected $consumerId;
        /** @var string Hex token */
        protected $accessToken;
@@ -75,7 +75,7 @@
        /**
         * @param \DBConnRef $db
         * @param string $token Access token
-        * @param integer $flags MWOAuthConsumerAcceptance::READ_* bitfield
+        * @param int $flags MWOAuthConsumerAcceptance::READ_* bitfield
         * @return MWOAuthConsumerAcceptance|bool
         */
        public static function newFromToken( \DBConnRef $db, $token, $flags = 0 
) {
@@ -100,7 +100,7 @@
         * @param String $userId of user who authorized (central wiki's id)
         * @param MWOAuthConsumer $consumer
         * @param String $wiki wiki associated with the acceptance
-        * @param integer $flags MWOAuthConsumerAcceptance::READ_* bitfield
+        * @param int $flags MWOAuthConsumerAcceptance::READ_* bitfield
         * @return MWOAuthConsumerAcceptance|bool
         */
        public static function newFromUserConsumerWiki(
diff --git a/backend/MWOAuthDAO.php b/backend/MWOAuthDAO.php
index d5e7721..f55b60f 100644
--- a/backend/MWOAuthDAO.php
+++ b/backend/MWOAuthDAO.php
@@ -28,7 +28,7 @@
  */
 abstract class MWOAuthDAO implements \IDBAccessObject {
        private $daoOrigin = 'new'; // string; object construction origin
-       private $daoPending = true; // boolean; whether fields changed or the 
field is new
+       private $daoPending = true; // bool; whether fields changed or the 
field is new
 
        /** @var \\Psr\\Log\\LoggerInterface */
        protected $logger;
@@ -67,8 +67,8 @@
 
        /**
         * @param \DBConnRef $db
-        * @param integer $id
-        * @param integer $flags MWOAuthDAO::READ_* bitfield
+        * @param int $id
+        * @param int $flags MWOAuthDAO::READ_* bitfield
         * @return MWOAuthDAO|bool Returns false if not found
         * @throws \DBError
         */
@@ -218,7 +218,7 @@
         * Get the schema information for this object type
         *
         * This should return an associative array with:
-        *   - idField        : a field with an integer/hex UNIQUE identifier
+        *   - idField        : a field with an int/hex UNIQUE identifier
         *   - autoIncrField  : a field that auto-increments in the DB (or NULL 
if none)
         *   - table          : a table name
         *   - fieldColumnMap : a map of field names to column names
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index f98e6c4..6cc61d1 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -237,6 +237,7 @@
        /**
         * Wrap the call to the parent function and check that the source IP of
         * the request is allowed by this consumer's restrictions.
+        * @param MWOAuthRequest &$request
         * @return array
         */
        public function verify_request( &$request ) {
diff --git a/backend/MWOAuthSignatureMethod.php 
b/backend/MWOAuthSignatureMethod.php
index 161e4fa..47aa206 100644
--- a/backend/MWOAuthSignatureMethod.php
+++ b/backend/MWOAuthSignatureMethod.php
@@ -43,6 +43,9 @@
        /**
         * If you want to reuse this code to write your Consumer, implement
         * this function to get your private key, so you can sign the request.
+        * @param OAuthRequest &$request
+        * @return string
+        * @throws OAuthException
         */
        protected function fetch_private_cert( &$request ) {
                if ( $this->privateKey === null ) {
diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php
index 2fc7845..c5c1546 100644
--- a/backend/MWOAuthUtils.php
+++ b/backend/MWOAuthUtils.php
@@ -23,7 +23,7 @@
        }
 
        /**
-        * @param integer $index DB_MASTER/DB_SLAVE
+        * @param int $index DB_MASTER/DB_SLAVE
         * @return \DBConnRef
         */
        public static function getCentralDB( $index ) {
@@ -93,7 +93,7 @@
        /**
         * Test this request for an OAuth Authorization header
         * @param \WebRequest $request the MediaWiki request
-        * @return Boolean (true if a header was found)
+        * @return bool true if a header was found
         */
        public static function hasOAuthHeaders( \WebRequest $request ) {
                $header = $request->getHeader( 'Authorization' );
@@ -106,6 +106,7 @@
        /**
         * Make a cache key for the given arguments, that (hopefully) won't 
clash with
         * anything else in your cache
+        * @return string
         */
        public static function getCacheKey( /* varags */ ) {
                global $wgMWOAuthCentralWiki;
@@ -204,7 +205,7 @@
        /**
         * Given a central wiki user ID, get a central user name
         *
-        * @param integer $userId
+        * @param int $userId
         * @param bool|\User $audience show hidden names based on this user, or 
false for public
         * @throws \MWException
         * @return string|bool User name, false if not found, empty string if 
name is hidden
@@ -234,7 +235,7 @@
        /**
         * Given a central wiki user ID, get a local User object
         *
-        * @param integer $userId
+        * @param int $userId
         * @throws \MWException
         * @return \User|bool User or false if not found
         */
@@ -259,7 +260,7 @@
         *
         * @param \User $user
         * @throws \MWException
-        * @return integer|bool ID or false if not found
+        * @return int|bool ID or false if not found
         */
        public static function getCentralIdFromLocalUser( \User $user ) {
                global $wgMWOAuthSharedUserIDs, $wgMWOAuthSharedUserSource;
@@ -291,7 +292,7 @@
         * Given a username, get the user ID for that user on the central wiki.
         * @param string $username
         * @throws \MWException
-        * @return integer|bool ID or false if not found
+        * @return int|bool ID or false if not found
         */
        public static function getCentralIdFromUserName( $username ) {
                global $wgMWOAuthSharedUserIDs, $wgMWOAuthSharedUserSource;
diff --git a/control/MWOAuthSubmitControl.php b/control/MWOAuthSubmitControl.php
index 0892b79..b457678 100644
--- a/control/MWOAuthSubmitControl.php
+++ b/control/MWOAuthSubmitControl.php
@@ -109,7 +109,7 @@
         * @param array $allValues
         * @param \HTMLForm $form
         * @throws \MWException
-        * @return boolean|string
+        * @return bool|string
         */
        public function validateFieldInternal( $field, $value, $allValues, 
$form ) {
                if ( !isset( $allValues['action'] ) && isset( 
$this->vals['action'] ) ) {
@@ -207,7 +207,7 @@
        /**
         * @param string $error API error key
         * @param string $msg Message key
-        * @param mixed ... Additional arguments used as message parameters
+        * @param mixed $params,... Additional arguments used as message 
parameters
         * @return \Status
         */
        protected function failure( $error, $msg /*, params */ ) {
diff --git a/phpcs.xml b/phpcs.xml
index 61024c7..5314dd3 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -4,9 +4,6 @@
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic"/>
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected"/>
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment"/>
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingReturn"/>
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag"/>
-               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName"/>
                <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
                <exclude 
name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName"/>
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4533c509b893790b05420d1b9132f3de7297c3e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
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

Reply via email to