Use correct variable name in @param documentation
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 11 Aug 2017 16:09:41 +0000 (18:09 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 11 Aug 2017 17:27:19 +0000 (19:27 +0200)
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8

39 files changed:
includes/FauxRequest.php
includes/GlobalFunctions.php
includes/Message.php
includes/OutputPage.php
includes/api/ApiAuthManagerHelper.php
includes/api/ApiBase.php
includes/api/ApiMain.php
includes/api/SearchApi.php
includes/collation/CustomUppercaseCollation.php
includes/context/ContextSource.php
includes/context/RequestContext.php
includes/htmlform/HTMLForm.php
includes/libs/MemoizedCallable.php
includes/libs/MultiHttpClient.php
includes/libs/filebackend/FileBackend.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/MultiWriteBagOStuff.php
includes/libs/objectcache/WANObjectCache.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/logging/LogEventsList.php
includes/mail/UserMailer.php
includes/media/WebP.php
includes/parser/ParserOptions.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderContext.php
includes/revisiondelete/RevDelList.php
includes/search/SearchExactMatchRescorer.php
includes/search/SearchSuggestion.php
includes/session/PHPSessionHandler.php
includes/session/SessionProvider.php
includes/skins/BaseTemplate.php
includes/specials/SpecialFilepath.php
includes/specials/SpecialMediaStatistics.php
includes/user/User.php
includes/utils/AutoloadGenerator.php
phpcs.xml
tests/parser/ParserTestRunner.php
tests/phpunit/includes/auth/LegacyHookPreAuthenticationProviderTest.php

index 3b2283b..9147240 100644 (file)
@@ -126,7 +126,7 @@ class FauxRequest extends WebRequest {
 
        /**
         * @since 1.26
-        * @param string $name Unprefixed name of the cookie to set
+        * @param string $key Unprefixed name of the cookie to set
         * @param string|null $value Value of the cookie to set
         * @param string|null $prefix Cookie prefix. Defaults to $wgCookiePrefix
         */
index b35a1f0..49159ed 100644 (file)
@@ -2234,7 +2234,8 @@ function wfIniGetBool( $setting ) {
  * (https://bugs.php.net/bug.php?id=26285) and the locale problems on Linux in
  * PHP 5.2.6+ (bug backported to earlier distro releases of PHP).
  *
- * @param string ... strings to escape and glue together, or a single array of strings parameter
+ * @param string $args,... strings to escape and glue together,
+ *  or a single array of strings parameter
  * @return string
  */
 function wfEscapeShellArg( /*...*/ ) {
index be6b0af..8777c6f 100644 (file)
@@ -488,7 +488,7 @@ class Message implements MessageSpecifier, Serializable {
         *
         * @since 1.17
         *
-        * @param mixed ... Parameters as strings or arrays from
+        * @param mixed $args,... Parameters as strings or arrays from
         *  Message::numParam() and the like, or a single array of parameters.
         *
         * @return Message $this
index 57cb194..8f62a85 100644 (file)
@@ -688,7 +688,7 @@ class OutputPage extends ContextSource {
         * Add one or more head items to the output
         *
         * @since 1.28
-        * @param string|string[] $value Raw HTML
+        * @param string|string[] $values Raw HTML
         */
        public function addHeadItems( $values ) {
                $this->mHeadItems = array_merge( $this->mHeadItems, (array)$values );
@@ -3797,7 +3797,7 @@ class OutputPage extends ContextSource {
         * Caller is responsible for ensuring the file exists. Emits a PHP warning otherwise.
         *
         * @since 1.27
-        * @param string $remotePath URL path prefix that points to $localPath
+        * @param string $remotePathPrefix URL path prefix that points to $localPath
         * @param string $localPath File directory exposed at $remotePath
         * @param string $file Path to target file relative to $localPath
         * @return string URL
index 3a9fb73..d6b9f76 100644 (file)
@@ -229,8 +229,8 @@ class ApiAuthManagerHelper {
 
        /**
         * Logs successful or failed authentication.
-        * @param string|AuthenticationResponse $result Response or error message
         * @param string $event Event type (e.g. 'accountcreation')
+        * @param string|AuthenticationResponse $result Response or error message
         */
        public function logAuthenticationResult( $event, $result ) {
                if ( is_string( $result ) ) {
@@ -345,7 +345,7 @@ class ApiAuthManagerHelper {
        /**
         * Fetch the standard parameters this helper recognizes
         * @param string $action AuthManager action
-        * @param string $param... Parameters to use
+        * @param string $param,... Parameters to use
         * @return array
         */
        public static function getStandardParams( $action, $param /* ... */ ) {
index 81696e0..2012e7d 100644 (file)
@@ -668,7 +668,7 @@ abstract class ApiBase extends ContextSource {
 
        /**
         * Set the continuation manager
-        * @param ApiContinuationManager|null
+        * @param ApiContinuationManager|null $manager
         */
        public function setContinuationManager( $manager ) {
                // Main module has setContinuationManager() method overridden
index 6468235..f6dd524 100644 (file)
@@ -370,7 +370,7 @@ class ApiMain extends ApiBase {
 
        /**
         * Set the continuation manager
-        * @param ApiContinuationManager|null
+        * @param ApiContinuationManager|null $manager
         */
        public function setContinuationManager( $manager ) {
                if ( $manager !== null ) {
index fb9c4e6..552292b 100644 (file)
@@ -144,7 +144,7 @@ trait SearchApi {
         *    one ( to support the continue parameter )
         *  - namespace: mandatory
         *  - search engine profiles defined by SearchApi::getSearchProfileParams()
-        * @param string[]|null API request params (must be sanitized by
+        * @param string[]|null $params API request params (must be sanitized by
         * ApiBase::extractRequestParams() before)
         * @return SearchEngine the search engine
         */
index 1b96bff..301972d 100644 (file)
@@ -48,7 +48,7 @@ class CustomUppercaseCollation extends NumericUppercaseCollation {
         * @note This assumes $alphabet does not contain U+F3000-U+F303F
         *
         * @param array $alphabet Sorted array of uppercase characters.
-        * @param Language $language What language for number sorting.
+        * @param Language $lang What language for number sorting.
         */
        public function __construct( array $alphabet, Language $lang ) {
                // It'd be trivial to extend this past 64, you'd just
index 434201a..cea8460 100644 (file)
@@ -183,7 +183,7 @@ abstract class ContextSource implements IContextSource {
         * @since 1.18
         * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
         *   or a MessageSpecifier.
-        * @param mixed ...
+        * @param mixed $args,...
         * @return Message
         */
        public function msg( $key /* $args */ ) {
index 2ac4192..4a772ee 100644 (file)
@@ -451,7 +451,7 @@ class RequestContext implements IContextSource, MutableContext {
         *
         * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
         *   or a MessageSpecifier.
-        * @param mixed ...
+        * @param mixed $args,...
         * @return Message
         */
        public function msg( $key ) {
index dda9e88..7293b99 100644 (file)
@@ -271,7 +271,7 @@ class HTMLForm extends ContextSource {
         * Construct a HTMLForm object for given display type. May return a HTMLForm subclass.
         *
         * @param string $displayFormat
-        * @param mixed $arguments... Additional arguments to pass to the constructor.
+        * @param mixed $arguments,... Additional arguments to pass to the constructor.
         * @return HTMLForm
         */
        public static function factory( $displayFormat/*, $arguments...*/ ) {
index 01adeab..90c7a64 100644 (file)
@@ -134,7 +134,7 @@ class MemoizedCallable {
         *
         * Like MemoizedCallable::invokeArgs(), but variadic.
         *
-        * @param mixed ...$params Parameters for memoized function or method.
+        * @param mixed $params,... Parameters for memoized function or method.
         * @return mixed The memoized callable's return value.
         */
        public function invoke() {
index 4f6195c..6c48cee 100644 (file)
@@ -435,7 +435,7 @@ class MultiHttpClient implements LoggerAwareInterface {
        /**
         * Register a logger
         *
-        * @param LoggerInterface
+        * @param LoggerInterface $logger
         */
        public function setLogger( LoggerInterface $logger ) {
                $this->logger = $logger;
index 6f51081..51308c1 100644 (file)
@@ -1591,7 +1591,7 @@ abstract class FileBackend implements LoggerAwareInterface {
         *   - StatusValue::newGood() if this method is called without parameters
         *   - StatusValue::newFatal() with all parameters to this method if passed in
         *
-        * @param ... string
+        * @param string $args,...
         * @return StatusValue
         */
        final protected function newStatus() {
index e0f2750..a262e0e 100644 (file)
@@ -747,7 +747,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         * Make a global cache key.
         *
         * @since 1.27
-        * @param string ... Key component (variadic)
+        * @param string $keys,... Key component
         * @return string
         */
        public function makeGlobalKey() {
@@ -758,7 +758,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         * Make a cache key, scoped to this instance's keyspace.
         *
         * @since 1.27
-        * @param string ... Key component (variadic)
+        * @param string $keys,... Key component
         * @return string
         */
        public function makeKey() {
index d94578d..65f3a8a 100644 (file)
@@ -174,7 +174,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         * @param integer $count
         * @param bool $asyncWrites
         * @param string $method
-        * @param mixed ...
+        * @param mixed $args,...
         * @return bool
         */
        protected function doWrite( $count, $asyncWrites, $method /*, ... */ ) {
index 4f90c7d..a80ed8d 100644 (file)
@@ -1315,7 +1315,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
 
        /**
         * @see BagOStuff::makeKey()
-        * @param string ... Key component
+        * @param string $keys,... Key component
         * @return string
         * @since 1.27
         */
@@ -1325,7 +1325,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
 
        /**
         * @see BagOStuff::makeGlobalKey()
-        * @param string ... Key component
+        * @param string $keys,... Key component
         * @return string
         * @since 1.27
         */
index b8b44e6..0726b5a 100644 (file)
@@ -3190,7 +3190,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         * @see WANObjectCache::getWithSetCallback()
         *
         * @param IDatabase $db1
-        * @param IDatabase ...
+        * @param IDatabase $dbs,...
         * @return array Map of values:
         *   - lag: highest lag of any of the DBs or false on error (e.g. replication stopped)
         *   - since: oldest UNIX timestamp of any of the DB lag estimates
index 6e328f4..117df68 100644 (file)
@@ -40,7 +40,7 @@ interface ILBFactory {
         *
         * Sub-classes will extend the required keys in $conf with additional parameters
         *
-        * @param $conf $params Array with keys:
+        * @param array $conf Array with keys:
         *  - localDomain: A DatabaseDomain or domain ID string.
         *  - readOnlyReason : Reason the master DB is read-only if so [optional]
         *  - srvCache : BagOStuff object for server cache [optional]
index 2b09cca..00d3bd3 100644 (file)
@@ -60,7 +60,7 @@ class LogEventsList extends ContextSource {
         *
         * @param IContextSource|Skin $context Context to use; formerly it was
         *   a Skin object. Use of Skin is deprecated.
-        * @param LinkRenderer|null $linkRenderer, previously unused
+        * @param LinkRenderer|null $linkRenderer previously unused
         * @param int $flags Can be a combination of self::NO_ACTION_LINK,
         *   self::NO_EXTRA_USER_LINKS or self::USE_CHECKBOXES.
         */
index 1f8489f..cb07fd5 100644 (file)
@@ -102,7 +102,7 @@ class UserMailer {
         * @param MailAddress $from Sender's email
         * @param string $subject Email's subject.
         * @param string $body Email's text or Array of two strings to be the text and html bodies
-        * @param array $options:
+        * @param array $options Keys:
         *     'replyTo' MailAddress
         *     'contentType' string default 'text/plain; charset=UTF-8'
         *     'headers' array Extra headers to set
@@ -196,7 +196,7 @@ class UserMailer {
         * @param MailAddress $from Sender's email
         * @param string $subject Email's subject.
         * @param string $body Email's text or Array of two strings to be the text and html bodies
-        * @param array $options:
+        * @param array $options Keys:
         *     'replyTo' MailAddress
         *     'contentType' string default 'text/plain; charset=UTF-8'
         *     'headers' array Extra headers to set
index e2c2d2d..4555c19 100644 (file)
@@ -86,7 +86,7 @@ class WebPHandler extends BitmapHandler {
        /**
         * Extracts the image size and WebP type from a file
         *
-        * @param string $chunks Chunks as extracted by RiffExtractor
+        * @param string $filename
         * @return array|bool Header data array with entries 'compression', 'width' and 'height',
         * where 'compression' can be 'lossy', 'lossless', 'animated' or 'unknown'. False if
         * file is not a valid WebP file.
index 73a9927..5e2845f 100644 (file)
@@ -761,7 +761,7 @@ class ParserOptions {
         * is it allowed in the specific case of parsing this page.
         * @see self::getAllowUnsafeRawHtml()
         * @since 1.29
-        * @param bool|null Value to set or null to get current value
+        * @param bool|null $x Value to set or null to get current value
         * @return bool Current value for allowUnsafeRawHtml
         */
        public function setAllowUnsafeRawHtml( $x ) {
index ad16420..c58bb00 100644 (file)
@@ -655,7 +655,7 @@ class ResourceLoader implements LoggerAwareInterface {
         *
         * @since 1.26
         * @param ResourceLoaderContext $context
-        * @param string[] $modules List of known module names
+        * @param string[] $moduleNames List of known module names
         * @return string Hash
         */
        public function getCombinedVersion( ResourceLoaderContext $context, array $moduleNames ) {
index f99114e..cbb0bec 100644 (file)
@@ -224,7 +224,7 @@ class ResourceLoaderContext implements MessageLocalizer {
         * @since 1.27
         * @param string|string[]|MessageSpecifier $key Message key, or array of keys,
         *   or a MessageSpecifier.
-        * @param mixed ...
+        * @param mixed $args,...
         * @return Message
         */
        public function msg( $key ) {
index 64a6aec..a2c58e6 100644 (file)
@@ -402,7 +402,7 @@ abstract class RevDelList extends RevisionListBase {
        /**
         * A hook for setVisibility(): do any necessary updates post-commit.
         * STUB
-        * @param array [id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ]
+        * @param array $visibilityChangeMap [id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ]
         * @return Status
         */
        public function doPostCommitUpdates( array $visibilityChangeMap ) {
index 40cfe39..0e99ba9 100644 (file)
@@ -35,8 +35,8 @@ class SearchExactMatchRescorer {
         * to not be in the results or be lower down the list.
         * @param string $search the query
         * @param int[] $namespaces the namespaces
-        * @param int $limit the max number of results to return
         * @param string[] $srchres results
+        * @param int $limit the max number of results to return
         * @return string[] munged results
         */
        public function rescore( $search, $namespaces, $srchres, $limit ) {
index 4e7c782..7f433db 100644 (file)
@@ -53,7 +53,7 @@ class SearchSuggestion {
        /**
         * Construct a new suggestion
         * @param float $score the suggestion score
-        * @param string $text|null the suggestion text
+        * @param string|null $text the suggestion text
         * @param Title|null $suggestedTitle the suggested title
         * @param int|null $suggestedTitleID the suggested title ID
         */
index 084ac05..b76f0ff 100644 (file)
@@ -145,7 +145,7 @@ class PHPSessionHandler implements \SessionHandlerInterface {
         * @private Use self::install().
         * @param SessionManager $manager
         * @param BagOStuff $store
-        * @param LoggerInterface $store
+        * @param LoggerInterface $logger
         */
        public function setManager(
                SessionManager $manager, BagOStuff $store, LoggerInterface $logger
index 3cf69b7..ba075e0 100644 (file)
@@ -387,7 +387,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * reset whatever token it does use here.
         *
         * @protected For use by \MediaWiki\Session\SessionManager only
-        * @param User $user;
+        * @param User $user
         */
        public function invalidateSessionsForUser( User $user ) {
        }
index aad676f..55f7a67 100644 (file)
@@ -29,7 +29,7 @@ abstract class BaseTemplate extends QuickTemplate {
         * Get a Message object with its context set
         *
         * @param string $name Message name
-        * @param ... $params Message params
+        * @param mixed $params,... Message params
         * @return Message
         */
        public function getMsg( $name /* ... */ ) {
index 49caaa3..c18faa1 100644 (file)
@@ -35,7 +35,7 @@ class SpecialFilepath extends RedirectSpecialPage {
        /**
         * Implement by redirecting through Special:Redirect/file.
         *
-        * @param string|null $subpage
+        * @param string|null $par
         * @return Title
         */
        public function getRedirect( $par ) {
index 44e0db8..83efbcb 100644 (file)
@@ -169,7 +169,7 @@ class MediaStatisticsPage extends QueryPage {
         *
         * @param string $mime mime type (e.g. image/jpeg)
         * @param int $count Number of images of this type
-        * @param int $totalBytes Total space for images of this type
+        * @param int $bytes Total space for images of this type
         */
        protected function outputTableRow( $mime, $count, $bytes ) {
                $mimeSearch = SpecialPage::getTitleFor( 'MIMEsearch', $mime );
index d6b63a8..71a4272 100644 (file)
@@ -3519,7 +3519,7 @@ class User implements IDBAccessObject {
        /**
         * Check if user is allowed to access a feature / make an action
         *
-        * @param string ... Permissions to test
+        * @param string $permissions,... Permissions to test
         * @return bool True if user is allowed to perform *any* of the given actions
         */
        public function isAllowedAny() {
@@ -3534,7 +3534,7 @@ class User implements IDBAccessObject {
 
        /**
         *
-        * @param string ... Permissions to test
+        * @param string $permissions,... Permissions to test
         * @return bool True if the user is allowed to perform *all* of the given actions
         */
        public function isAllowedAll() {
index 8931e3c..19f5100 100644 (file)
@@ -372,7 +372,7 @@ class ClassCollector {
        /**
         * Accepts the next token in an expect sequence
         *
-        * @param array
+        * @param array $token
         */
        protected function tryEndExpect( $token ) {
                switch ( $this->startToken[0] ) {
index 3ea3048..b1ad8d2 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -10,7 +10,6 @@
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Protected" />
                <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Public" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamName" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamType" />
index e578418..f694f39 100644 (file)
@@ -477,7 +477,7 @@ class ParserTestRunner {
         * @see staticSetup
         *
         * @param array $teardown The snippet array
-        * @param ScopedCallback|null A ScopedCallback to consume
+        * @param ScopedCallback|null $nextTeardown A ScopedCallback to consume
         * @return ScopedCallback
         */
        protected function createTeardownObject( $teardown, $nextTeardown = null ) {
index 3b00194..a4b980f 100644 (file)
@@ -282,7 +282,7 @@ class LegacyHookPreAuthenticationProviderTest extends \MediaWikiTestCase {
         * @dataProvider provideTestForAccountCreation
         * @param string $msg
         * @param Status|null $status
-        * @param StatusValue Result
+        * @param StatusValue $result Result
         */
        public function testTestForAccountCreation( $msg, $status, $result ) {
                $this->hook( 'AbortNewAccount', $this->once() )