From 230958d97c44eee2499e02cb95fd08e8810ac534 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 19 May 2018 13:46:54 -0700 Subject: [PATCH] Autofix MediaWiki.Commenting.FunctionComment.SpacingDoc* errors Change-Id: I63761ebce04c03b9b13237919c27cc10180f198f --- .phpcs.xml | 2 -- includes/Block.php | 2 +- includes/GlobalFunctions.php | 2 +- includes/Linker.php | 6 ++--- includes/Title.php | 4 +-- includes/http/Http.php | 2 +- includes/libs/CryptHKDF.php | 2 +- includes/libs/MultiHttpClient.php | 2 +- includes/parser/Parser.php | 2 +- includes/parser/ParserOutput.php | 3 +-- includes/password/UserPasswordPolicy.php | 4 +-- .../ResourceLoaderStartUpModule.php | 8 +++--- includes/utils/MWCryptHKDF.php | 2 +- languages/Language.php | 10 +++---- languages/LanguageConverter.php | 10 +++---- languages/classes/LanguageKsh.php | 26 +++++++++---------- tests/phpunit/includes/TestLogger.php | 4 +-- 17 files changed, 44 insertions(+), 47 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 616fa23b48..b0fb6f5107 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -21,8 +21,6 @@ - - diff --git a/includes/Block.php b/includes/Block.php index 2bae13b777..2ce1f3ebfc 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -521,7 +521,7 @@ class Block { * * @param IDatabase $dbw If you have one available * @return bool|array False on failure, assoc array on success: - * ('id' => block ID, 'autoIds' => array of autoblock IDs) + * ('id' => block ID, 'autoIds' => array of autoblock IDs) */ public function insert( $dbw = null ) { global $wgBlockDisablesLogin; diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7e8df7ee48..c11a9bd4a9 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3228,7 +3228,7 @@ function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) { * @param string $format The format string (See php's docs) * @param string $data A binary string of binary data * @param int|bool $length The minimum length of $data or false. This is to - * prevent reading beyond the end of $data. false to disable the check. + * prevent reading beyond the end of $data. false to disable the check. * * Also be careful when using this function to read unsigned 32 bit integer * because php might make it negative. diff --git a/includes/Linker.php b/includes/Linker.php index 5fc5eb1c29..5cdbfee140 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1221,9 +1221,9 @@ class Linker { * @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser * * @param string $comment Text to format links in. WARNING! Since the output of this - * function is html, $comment must be sanitized for use as html. You probably want - * to pass $comment through Sanitizer::escapeHtmlAllowEntities() before calling - * this function. + * function is html, $comment must be sanitized for use as html. You probably want + * to pass $comment through Sanitizer::escapeHtmlAllowEntities() before calling + * this function. * @param Title|null $title An optional title object used to links to sections * @param bool $local Whether section links should refer to local page * @param string|null $wikiId Id of the wiki to link to (if not the local wiki), diff --git a/includes/Title.php b/includes/Title.php index 7f0dbd7d3c..fd7451cbc3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -207,8 +207,8 @@ class Title implements LinkTarget { * Create a new Title from a prefixed DB key * * @param string $key The database key, which has underscores - * instead of spaces, possibly including namespace and - * interwiki prefixes + * instead of spaces, possibly including namespace and + * interwiki prefixes * @return Title|null Title, or null on an error */ public static function newFromDBkey( $key ) { diff --git a/includes/http/Http.php b/includes/http/Http.php index 6eff6c9cbd..c0005c5ae5 100644 --- a/includes/http/Http.php +++ b/includes/http/Http.php @@ -33,7 +33,7 @@ class Http { * @param string $method HTTP method. Usually GET/POST * @param string $url Full URL to act on. If protocol-relative, will be expanded to an http:// URL * @param array $options Options to pass to MWHttpRequest object. - * Possible keys for the array: + * Possible keys for the array: * - timeout Timeout length in seconds * - connectTimeout Timeout for connection, in seconds (curl only) * - postData An array of key-value pairs or a url-encoded form data diff --git a/includes/libs/CryptHKDF.php b/includes/libs/CryptHKDF.php index 6b3e4a7aca..c41aab339c 100644 --- a/includes/libs/CryptHKDF.php +++ b/includes/libs/CryptHKDF.php @@ -217,7 +217,7 @@ class CryptHKDF { * @param string $ikm The input keying material * @param string $salt The salt to add to the ikm, to get the prk * @param string $info Optional context (change the output without affecting - * the randomness properties of the output) + * the randomness properties of the output) * @param int $L Number of bytes to return * @return string Cryptographically secure pseudorandom binary string */ diff --git a/includes/libs/MultiHttpClient.php b/includes/libs/MultiHttpClient.php index 053a5ff45b..654b1896a8 100644 --- a/includes/libs/MultiHttpClient.php +++ b/includes/libs/MultiHttpClient.php @@ -107,7 +107,7 @@ class MultiHttpClient implements LoggerAwareInterface { * - error : Any cURL error string * The map also stores integer-indexed copies of these values. This lets callers do: * @code - * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req ); + * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req ); * @endcode * @param array $req HTTP request array * @param array $opts diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ac20b6af63..2ccd4ce387 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2997,7 +2997,7 @@ class Parser { * 'expansion-depth-exceeded-category') * @param string|int|null $current Current value * @param string|int|null $max Maximum allowed, when an explicit limit has been - * exceeded, provide the values (optional) + * exceeded, provide the values (optional) */ public function limitationWarn( $limitationType, $current = '', $max = '' ) { # does no harm if $current and $max are present but are unnecessary for the message diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index aa015a6eb1..fc366599dd 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -906,8 +906,7 @@ class ParserOutput extends CacheTime { * * To implement hidden categories, hiding pages from category listings * by storing a property. * - * * Overriding the displayed article title. - * @see ParserOutput::setDisplayTitle() + * * Overriding the displayed article title (ParserOutput::setDisplayTitle()). * * * To implement image tagging, for example displaying an icon on an * image thumbnail to indicate that it is listed for deletion on diff --git a/includes/password/UserPasswordPolicy.php b/includes/password/UserPasswordPolicy.php index bf1f8acfb7..0c52354f1d 100644 --- a/includes/password/UserPasswordPolicy.php +++ b/includes/password/UserPasswordPolicy.php @@ -68,7 +68,7 @@ class UserPasswordPolicy { * @param User $user who's policy we are checking * @param string $password the password to check * @return Status error to indicate the password didn't meet the policy, or fatal to - * indicate the user shouldn't be allowed to login. + * indicate the user shouldn't be allowed to login. */ public function checkUserPassword( User $user, $password ) { $effectivePolicy = $this->getPoliciesForUser( $user ); @@ -88,7 +88,7 @@ class UserPasswordPolicy { * @param string $password the password to check * @param array $groups list of groups to which we assume the user belongs * @return Status error to indicate the password didn't meet the policy, or fatal to - * indicate the user shouldn't be allowed to login. + * indicate the user shouldn't be allowed to login. */ public function checkUserPasswordForGroups( User $user, $password, array $groups ) { $effectivePolicy = self::getPoliciesForGroups( diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 2e3c6fc161..8142ff5bb4 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -171,10 +171,10 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { * Optimize the dependency tree in $this->modules. * * The optimization basically works like this: - * Given we have module A with the dependencies B and C - * and module B with the dependency C. - * Now we don't have to tell the client to explicitly fetch module - * C as that's already included in module B. + * Given we have module A with the dependencies B and C + * and module B with the dependency C. + * Now we don't have to tell the client to explicitly fetch module + * C as that's already included in module B. * * This way we can reasonably reduce the amount of module registration * data send to the client. diff --git a/includes/utils/MWCryptHKDF.php b/includes/utils/MWCryptHKDF.php index 1c8d4861af..d0fe6ccca4 100644 --- a/includes/utils/MWCryptHKDF.php +++ b/includes/utils/MWCryptHKDF.php @@ -67,7 +67,7 @@ class MWCryptHKDF { * @param string $ikm The input keying material * @param string $salt The salt to add to the ikm, to get the prk * @param string $info Optional context (change the output without affecting - * the randomness properties of the output) + * the randomness properties of the output) * @param int $L Number of bytes to return * @return string Cryptographically secure pseudorandom binary string */ diff --git a/languages/Language.php b/languages/Language.php index d750f7d519..705c7288f2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -792,11 +792,11 @@ class Language { /** * Get an array of language names, indexed by code. * @param null|string $inLanguage Code of language in which to return the names - * Use null for autonyms (native names) + * Use null for autonyms (native names) * @param string $include One of: - * 'all' all available languages - * 'mw' only if the language is defined in MediaWiki or wgExtraLanguageNames (default) - * 'mwfile' only if the language is in 'mw' *and* has a message file + * 'all' all available languages + * 'mw' only if the language is defined in MediaWiki or wgExtraLanguageNames (default) + * 'mwfile' only if the language is in 'mw' *and* has a message file * @return array Language code => language name * @since 1.20 */ @@ -3485,7 +3485,7 @@ class Language { * @param int $length Maximum length (including ellipsis) * @param string $ellipsis String to append to the truncated text * @param bool $adjustLength Subtract length of ellipsis from $length. - * $adjustLength was introduced in 1.18, before that behaved as if false. + * $adjustLength was introduced in 1.18, before that behaved as if false. * @return string */ function truncate( $string, $length, $ellipsis = '...', $adjustLength = true ) { diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index f611358d94..d11838a8b7 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -967,11 +967,11 @@ class LanguageConverter { * Parse the conversion table stored in the cache. * * The tables should be in blocks of the following form: - * -{ - * word => word ; - * word => word ; - * ... - * }- + * -{ + * word => word ; + * word => word ; + * ... + * }- * * To make the tables more manageable, subpages are allowed * and will be parsed recursively if $recursive == true. diff --git a/languages/classes/LanguageKsh.php b/languages/classes/LanguageKsh.php index 0185a030f9..22690099f4 100644 --- a/languages/classes/LanguageKsh.php +++ b/languages/classes/LanguageKsh.php @@ -52,28 +52,28 @@ class LanguageKsh extends Language { * Word order is irrelevant. * * Possible values specifying the grammatical case are: - * 1, Nominative - * 2, Genitive - * 3, Dative - * 4, Accusative, -omitted- + * 1, Nominative + * 2, Genitive + * 3, Dative + * 4, Accusative, -omitted- * * Possible values specifying the article type are: - * Betoont focussed or stressed article - * -omitted- unstressed or unfocussed article + * Betoont focussed or stressed article + * -omitted- unstressed or unfocussed article * * Possible values for the type of genitive are: - * Sing, Iehr prepositioned genitive = possessive dative - * Vun, Fon, -omitted- postpositioned genitive = preposition "vun" with dative + * Sing, Iehr prepositioned genitive = possessive dative + * Vun, Fon, -omitted- postpositioned genitive = preposition "vun" with dative * * Values of case overrides & prepositions, in the order of preceedence: - * Sing, Iehr possessive dative = prepositioned genitive - * Vun, Fon preposition "vun" with dative = postpositioned genitive - * En, em preposition "en" with dative + * Sing, Iehr possessive dative = prepositioned genitive + * Vun, Fon preposition "vun" with dative = postpositioned genitive + * En, em preposition "en" with dative * * Values for object gender specifiers of the possessive dative, or * prepositioned genitive, evaluated with "Sing, Iehr" of above only: - * Male a singular male object follows - * -omitted- a non-male or plural object follows + * Male a singular male object follows + * -omitted- a non-male or plural object follows * * We currently handle definite articles of the singular only. * There is a full set of test cases at: diff --git a/tests/phpunit/includes/TestLogger.php b/tests/phpunit/includes/TestLogger.php index 21d1bf2504..17a41823cc 100644 --- a/tests/phpunit/includes/TestLogger.php +++ b/tests/phpunit/includes/TestLogger.php @@ -40,8 +40,8 @@ class TestLogger extends \Psr\Log\AbstractLogger { * @param bool $collect Whether to collect logs. @see setCollect() * @param callable $filter Filter logs before collecting/printing. Signature is * string|null function ( string $message, string $level, array $context ); - * @param bool $collectContext Whether to keep the context passed to log. - * @since 1.29 @see setCollectContext() + * @param bool $collectContext Whether to keep the context passed to log + * (since 1.29, @see setCollectContext()). */ public function __construct( $collect = false, $filter = null, $collectContext = false ) { $this->collect = $collect; -- 2.20.1