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

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

Improve some parameter docs

Change-Id: I03cb69ef264334c3923771e57a02e32081217331
---
M AntiSpoofHooks.php
M AntiSpoof_body.php
M SpoofUser.php
M api/ApiAntiSpoof.php
M maintenance/BatchAntiSpoofClass.php
M phpcs.xml
6 files changed, 29 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiSpoof 
refs/changes/44/382744/1

diff --git a/AntiSpoofHooks.php b/AntiSpoofHooks.php
index b38f91c..809c7bc 100644
--- a/AntiSpoofHooks.php
+++ b/AntiSpoofHooks.php
@@ -23,7 +23,7 @@
        }
 
        /**
-        * @param $updater DatabaseUpdater
+        * @param DatabaseUpdater $updater
         * @return bool
         */
        public static function asUpdateSchema( DatabaseUpdater $updater ) {
@@ -35,8 +35,8 @@
        /**
         * Can be used to cancel user account creation
         *
-        * @param $user User
-        * @param $message string
+        * @param User $user
+        * @param string &$message
         * @return bool true to continue, false to abort user creation
         */
        public static function asAbortNewAccountHook( $user, &$message ) {
@@ -91,7 +91,7 @@
         * Set the ignore spoof thingie
         * (Manipulate the user create form)
         *
-        * @param $template UsercreateTemplate
+        * @param UsercreateTemplate &$template
         * @return bool
         */
        public static function asUserCreateFormHook( &$template ) {
@@ -109,7 +109,7 @@
         * On new account creation, record the username's thing-bob.
         * (Called after a user account is created)
         *
-        * @param $user User
+        * @param User $user
         * @return bool
         */
        public static function asAddNewAccountHook( $user ) {
@@ -122,7 +122,7 @@
         * On new account creation, record the username's thing-bob.
         * Replaces AddNewAccountHook for more modern MediaWiki versions-
         *
-        * @param $user User
+        * @param User $user
         * @return bool
         */
        public static function asLocalUserCreated( $user ) {
@@ -135,9 +135,9 @@
         * On rename, remove the old entry and add the new
         * (After a sucessful user rename)
         *
-        * @param $uid
-        * @param $oldName string
-        * @param $newName string
+        * @param string $uid
+        * @param string $oldName
+        * @param string $newName
         * @return bool
         */
        public static function asAddRenameUserHook( $uid, $oldName, $newName ) {
@@ -153,8 +153,8 @@
        }
 
        /**
-        * @param ApiBase $module
-        * @param array $params
+        * @param ApiBase &$module
+        * @param array &$params
         * @return bool
         */
        public static function onAPIGetAllowedParams( &$module, &$params ) {
diff --git a/AntiSpoof_body.php b/AntiSpoof_body.php
index d6d424a..3e8d7cc 100644
--- a/AntiSpoof_body.php
+++ b/AntiSpoof_body.php
@@ -150,7 +150,7 @@
        }
 
        /**
-        * @param $ch
+        * @param string $ch
         * @return string
         */
        private static function getScriptCode( $ch ) {
@@ -168,7 +168,7 @@
         * From the name of a script, get a script descriptor, if valid,
         * otherwise return None
         *
-        * @param $name
+        * @param string $name
         * @return null|string
         */
        private static function getScriptTag( $name ) {
@@ -184,8 +184,8 @@
        }
 
        /**
-        * @param $aList array
-        * @param $bList array
+        * @param array $aList
+        * @param array $bList
         * @return bool
         */
        private static function isSubsetOf( $aList, $bList ) {
@@ -195,7 +195,7 @@
        /**
         * Is this an allowed script mixture?
         *
-        * @param $scriptList
+        * @param array $scriptList
         * @return bool
         */
        private static function isAllowedScriptCombination( $scriptList ) {
@@ -216,7 +216,7 @@
 
        /**
         * Convert string into array of Unicode code points as integers
-        * @param $str
+        * @param string $str
         * @return array
         */
        public static function stringToList( $str ) {
@@ -232,7 +232,7 @@
        }
 
        /**
-        * @param $list array
+        * @param array $list
         * @return string
         */
        public static function listToString( $list ) {
@@ -244,7 +244,7 @@
        }
 
        /**
-        * @param $a_list array
+        * @param array $a_list
         * @return string
         */
        private static function hardjoin( $a_list ) {
@@ -260,8 +260,8 @@
        }
 
        /**
-        * @param $text
-        * @param $script
+        * @param array $text
+        * @param string $script
         * @return array
         */
        private static function stripScript( $text, $script ) {
@@ -278,8 +278,8 @@
        /*
         * Helper function for checkUnicodeString: Return an error on a bad 
character.
         * @todo I would like to show Unicode character name, but it is not 
clear how to get it.
-        * @param $msgId -- string, message identifier.
-        * @param $point -- number, codepoint of the bad character.
+        * @param string $msgId message identifier.
+        * @param number $point codepoint of the bad character.
         * @return Formatted error message.
         */
        private static function badCharErr( $msgId, $point ) {
@@ -300,7 +300,7 @@
 
        /**
         * TODO: does too much in one routine, refactor...
-        * @param $testName
+        * @param string $testName
         * @return array
         */
        public static function checkUnicodeString( $testName ) {
diff --git a/SpoofUser.php b/SpoofUser.php
index c375658..b791265 100644
--- a/SpoofUser.php
+++ b/SpoofUser.php
@@ -16,7 +16,7 @@
        private $error;
 
        /**
-        * @param $name string
+        * @param string $name
         */
        public function __construct( $name ) {
                $this->name = strval( $name );
diff --git a/api/ApiAntiSpoof.php b/api/ApiAntiSpoof.php
index e7d09d1..9633189 100644
--- a/api/ApiAntiSpoof.php
+++ b/api/ApiAntiSpoof.php
@@ -59,6 +59,7 @@
 
        /**
         * @see ApiBase::getExamplesMessages()
+        * @return array
         */
        protected function getExamplesMessages() {
                return [
diff --git a/maintenance/BatchAntiSpoofClass.php 
b/maintenance/BatchAntiSpoofClass.php
index c4092ee..a47be3b 100644
--- a/maintenance/BatchAntiSpoofClass.php
+++ b/maintenance/BatchAntiSpoofClass.php
@@ -18,7 +18,7 @@
        }
 
        /**
-        * @param $items array
+        * @param array $items
         */
        protected function batchRecord( $items ) {
                SpoofUser::batchRecord( $this->getDB( DB_MASTER ), $items );
@@ -39,7 +39,7 @@
        }
 
        /**
-        * @param $name string
+        * @param string $name
         * @return SpoofUser
         */
        protected function makeSpoofUser( $name ) {
diff --git a/phpcs.xml b/phpcs.xml
index d186523..558f893 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.Files.ClassMatchesFilename.NotMatch" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
@@ -13,8 +9,6 @@
        </rule>
        <file>.</file>
        <arg name="extensions" value="php,php5,inc" />
-       <arg name="encoding" value="utf8" />
+       <arg name="encoding" value="UTF-8" />
        <exclude-pattern>equivset.php</exclude-pattern>
-       <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>node_modules</exclude-pattern>
 </ruleset>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03cb69ef264334c3923771e57a02e32081217331
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to