Fix spacing for @param and indent of function comments
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 11 Aug 2017 21:45:25 +0000 (23:45 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 15 Aug 2017 14:33:29 +0000 (14:33 +0000)
In phpcs.xml rename renamed sniffs and add the failing sniffs,
because now the whole sniff is no longer excluded.

Change-Id: If5b0bd16028761abc2c47ace9e97d37ad14bb36f

22 files changed:
includes/content/ContentHandler.php
includes/content/TextContentHandler.php
includes/debug/logger/LegacyLogger.php
includes/exception/MWExceptionHandler.php
includes/filerepo/file/File.php
includes/filerepo/file/UnregisteredLocalFile.php
includes/libs/objectcache/RESTBagOStuff.php
includes/libs/stats/NullStatsdDataFactory.php
includes/media/MediaHandler.php
includes/page/WikiPage.php
includes/resourceloader/ResourceLoaderJqueryMsgModule.php
includes/search/NullIndexField.php
includes/search/SearchEngine.php
includes/search/SearchIndexField.php
includes/search/SearchIndexFieldDefinition.php
includes/search/SearchResult.php
includes/skins/QuickTemplate.php
includes/specials/SpecialMediaStatistics.php
includes/utils/BatchRowUpdate.php
includes/utils/BatchRowWriter.php
phpcs.xml
tests/phpunit/MediaWikiTestCase.php

index 90364f3..0509e29 100644 (file)
@@ -1135,9 +1135,9 @@ abstract class ContentHandler {
        /**
         * Add new field definition to array.
         * @param SearchIndexField[] &$fields
-        * @param SearchEngine       $engine
-        * @param string             $name
-        * @param int                $type
+        * @param SearchEngine $engine
+        * @param string $name
+        * @param int $type
         * @return SearchIndexField[] new field defs
         * @since 1.28
         */
@@ -1151,7 +1151,7 @@ abstract class ContentHandler {
         * as representation of this document.
         * Overriding class should call parent function or take care of calling
         * the SearchDataForIndex hook.
-        * @param WikiPage     $page Page to index
+        * @param WikiPage $page Page to index
         * @param ParserOutput $output
         * @param SearchEngine $engine Search engine for which we are indexing
         * @return array Map of name=>value for fields
@@ -1190,7 +1190,7 @@ abstract class ContentHandler {
         *
         * Specific content handlers may override it if they need different content handling.
         *
-        * @param WikiPage    $page
+        * @param WikiPage $page
         * @param ParserCache $cache
         * @return ParserOutput
         */
index 698a37b..ced2a66 100644 (file)
@@ -40,7 +40,7 @@ class TextContentHandler extends ContentHandler {
         * Returns the content's text as-is.
         *
         * @param Content $content
-        * @param string  $format The serialization format to check
+        * @param string $format The serialization format to check
         *
         * @return mixed
         */
index 6359509..06ec574 100644 (file)
@@ -454,14 +454,14 @@ class LegacyLogger extends AbstractLogger {
        }
 
        /**
-       * Log to a file without getting "file size exceeded" signals.
-       *
-       * Can also log to UDP with the syntax udp://host:port/prefix. This will send
-       * lines to the specified port, prefixed by the specified prefix and a space.
-       *
-       * @param string $text
-       * @param string $file Filename
-       */
+        * Log to a file without getting "file size exceeded" signals.
+        *
+        * Can also log to UDP with the syntax udp://host:port/prefix. This will send
+        * lines to the specified port, prefixed by the specified prefix and a space.
+        *
+        * @param string $text
+        * @param string $file Filename
+        */
        public static function emit( $text, $file ) {
                if ( substr( $file, 0, 4 ) == 'udp:' ) {
                        $transport = UDPTransport::newFromString( $file );
index a2867a1..bf232e9 100644 (file)
@@ -616,7 +616,7 @@ TXT;
         * @param ErrorException $e
         * @param string $channel
         * @param string $level
-       */
+        */
        protected static function logError(
                ErrorException $e, $channel, $level = LogLevel::ERROR
        ) {
index 9aa2b18..71e1c63 100644 (file)
@@ -355,7 +355,7 @@ abstract class File implements IDBAccessObject {
                return $this->url;
        }
 
-       /*
+       /**
         * Get short description URL for a files based on the page ID
         *
         * @return string|null
index b22f8cb..cdad5fc 100644 (file)
@@ -171,8 +171,8 @@ class UnregisteredLocalFile extends File {
        }
 
        /**
-       * @return int
-       */
+        * @return int
+        */
        function getBitDepth() {
                $gis = $this->getImageSize( $this->getLocalRefPath() );
 
index 730eed1..5d2577b 100644 (file)
@@ -56,7 +56,7 @@ class RESTBagOStuff extends BagOStuff {
        }
 
        /**
-        * @param string  $key
+        * @param string $key
         * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
         * @return mixed Returns false on failure and if the item does not exist
         */
@@ -82,7 +82,7 @@ class RESTBagOStuff extends BagOStuff {
        /**
         * Handle storage error
         * @param string $msg Error message
-        * @param int    $rcode Error code from client
+        * @param int $rcode Error code from client
         * @param string $rerr Error message from client
         * @return false
         */
@@ -99,9 +99,9 @@ class RESTBagOStuff extends BagOStuff {
         * Set an item
         *
         * @param string $key
-        * @param mixed  $value
-        * @param int    $exptime Either an interval in seconds or a unix timestamp for expiry
-        * @param int    $flags Bitfield of BagOStuff::WRITE_* constants
+        * @param mixed $value
+        * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+        * @param int $flags Bitfield of BagOStuff::WRITE_* constants
         * @return bool Success
         */
        public function set( $key, $value, $exptime = 0, $flags = 0 ) {
index f2e35b6..75d6b9e 100644 (file)
@@ -53,7 +53,6 @@ class NullStatsdDataFactory implements IBufferingStatsdDataFactory {
         * This function creates a 'increment' StatsdData object.
         *
         * @param string|array $key The metric(s) to increment.
-        * @param float|1      $sampleRate The rate (0-1) for sampling.
         *
         * @return array
         */
@@ -66,7 +65,6 @@ class NullStatsdDataFactory implements IBufferingStatsdDataFactory {
         *
         *
         * @param string|array $key The metric(s) to decrement.
-        * @param float|1      $sampleRate The rate (0-1) for sampling.
         *
         * @return mixed
         */
index 2f72181..aa7c62b 100644 (file)
@@ -874,7 +874,7 @@ abstract class MediaHandler {
         * @param Array $pagesByDimensions
         * @return String
         * @since 1.30
-       */
+        */
        public static function getPageRangesByDimensions( $pagesByDimensions ) {
                $pageRangesByDimensions = [];
 
index 4f4decf..e60f103 100644 (file)
@@ -1047,9 +1047,9 @@ class WikiPage implements Page, IDBAccessObject {
         *
         * @since 1.19
         * @param ParserOptions $parserOptions ParserOptions to use for the parse operation
-        * @param null|int      $oldid Revision ID to get the text from, passing null or 0 will
-        *                             get the current revision (default value)
-        * @param bool          $forceParse Force reindexing, regardless of cache settings
+        * @param null|int $oldid Revision ID to get the text from, passing null or 0 will
+        *   get the current revision (default value)
+        * @param bool $forceParse Force reindexing, regardless of cache settings
         * @return bool|ParserOutput ParserOutput or false if the revision was not found
         */
        public function getParserOutput(
@@ -3633,7 +3633,7 @@ class WikiPage implements Page, IDBAccessObject {
                return $this->getTitle()->getCanonicalURL();
        }
 
-       /*
+       /**
         * @param WANObjectCache $cache
         * @return string[]
         * @since 1.28
index 01476ed..bef34f9 100644 (file)
@@ -65,9 +65,9 @@ class ResourceLoaderJqueryMsgModule extends ResourceLoaderFileModule {
        }
 
        /**
-       * @param ResourceLoaderContext $context
-       * @return array
-       */
+        * @param ResourceLoaderContext $context
+        * @return array
+        */
        public function getScriptURLsForDebug( ResourceLoaderContext $context ) {
                // Bypass file module urls
                return ResourceLoaderModule::getScriptURLsForDebug( $context );
index 5ecf5c8..ff1e8cb 100644 (file)
@@ -17,7 +17,7 @@ class NullIndexField implements SearchIndexField {
        /**
         * Set global flag for this field.
         *
-        * @param int  $flag Bit flag to set/unset
+        * @param int $flag Bit flag to set/unset
         * @param bool $unset True if flag should be unset, false by default
         * @return $this
         */
index 1b9ee6c..7c2f0f2 100644 (file)
@@ -728,7 +728,7 @@ abstract class SearchEngine {
         * Create a search field definition.
         * Specific search engines should override this method to create search fields.
         * @param string $name
-        * @param int    $type One of the types in SearchIndexField::INDEX_TYPE_*
+        * @param int $type One of the types in SearchIndexField::INDEX_TYPE_*
         * @return SearchIndexField
         * @since 1.28
         */
index eb72662..6f3b207 100644 (file)
@@ -30,16 +30,19 @@ interface SearchIndexField {
         * This field is case-insensitive.
         */
        const FLAG_CASEFOLD = 1;
+
        /**
         * This field contains secondary information, which is
         * already present in other fields, but can be used for
         * scoring.
         */
        const FLAG_SCORING = 2;
+
        /**
         * This field does not need highlight handling.
         */
        const FLAG_NO_HIGHLIGHT = 4;
+
        /**
         * Do not index this field, just store it.
         */
@@ -51,20 +54,23 @@ interface SearchIndexField {
         * @return array|null Null means this field does not map to anything
         */
        public function getMapping( SearchEngine $engine );
+
        /**
         * Set global flag for this field.
         *
-        * @param int  $flag Bit flag to set/unset
+        * @param int $flag Bit flag to set/unset
         * @param bool $unset True if flag should be unset, false by default
         * @return $this
         */
        public function setFlag( $flag, $unset = false );
+
        /**
         * Check if flag is set.
         * @param int $flag
         * @return int 0 if unset, !=0 if set
         */
        public function checkFlag( $flag );
+
        /**
         * Merge two field definitions if possible.
         *
index 3e008ae..a11dff9 100644 (file)
@@ -9,24 +9,28 @@
  * @since 1.28
  */
 abstract class SearchIndexFieldDefinition implements SearchIndexField {
+
        /**
         * Name of the field
         *
         * @var string
         */
        protected $name;
+
        /**
         * Type of the field, one of the constants above
         *
         * @var int
         */
        protected $type;
+
        /**
         * Bit flags for the field.
         *
         * @var int
         */
        protected $flags = 0;
+
        /**
         * Subfields
         * @var SearchIndexFieldDefinition[]
@@ -40,7 +44,7 @@ abstract class SearchIndexFieldDefinition implements SearchIndexField {
 
        /**
         * @param string $name Field name
-        * @param int    $type Index type
+        * @param int $type Index type
         */
        public function __construct( $name, $type ) {
                $this->name = $name;
@@ -66,7 +70,7 @@ abstract class SearchIndexFieldDefinition implements SearchIndexField {
        /**
         * Set global flag for this field.
         *
-        * @param int  $flag Bit flag to set/unset
+        * @param int $flag Bit flag to set/unset
         * @param bool $unset True if flag should be unset, false by default
         * @return $this
         */
index 50db84b..dc294c3 100644 (file)
@@ -65,7 +65,7 @@ class SearchResult {
        /**
         * Return a new SearchResult and initializes it with a title.
         *
-        * @param Title           $title
+        * @param Title $title
         * @param SearchResultSet $parentSet
         * @return SearchResult
         */
index e7120e9..d1be4bb 100644 (file)
@@ -62,11 +62,11 @@ abstract class QuickTemplate {
        }
 
        /**
-       * extends the value of data with name $name with the value $value
-       * @since 1.25
-       * @param string $name
-       * @param mixed $value
-       */
+        * extends the value of data with name $name with the value $value
+        * @since 1.25
+        * @param string $name
+        * @param mixed $value
+        */
        public function extend( $name, $value ) {
                if ( $this->haveData( $name ) ) {
                        $this->data[$name] = $this->data[$name] . $value;
index 1789bb2..8d77091 100644 (file)
@@ -30,13 +30,15 @@ use Wikimedia\Rdbms\IDatabase;
  */
 class MediaStatisticsPage extends QueryPage {
        protected $totalCount = 0, $totalBytes = 0;
+
        /**
-       * @var integer $totalPerType Combined file size of all files in a section
-       */
+        * @var integer $totalPerType Combined file size of all files in a section
+        */
        protected $totalPerType = 0;
+
        /**
-       * @var integer $totalSize Combined file size of all files
-       */
+        * @var integer $totalSize Combined file size of all files
+        */
        protected $totalSize = 0;
 
        function __construct( $name = 'MediaStatistics' ) {
index fc8bde9..f42b5a0 100644 (file)
@@ -64,9 +64,9 @@ class BatchRowUpdate {
        protected $output;
 
        /**
-        * @param BatchRowIterator   $reader    Iterator that returns an
+        * @param BatchRowIterator $reader Iterator that returns an
         *  array of database rows
-        * @param BatchRowWriter     $writer    Writer capable of pushing
+        * @param BatchRowWriter $writer Writer capable of pushing
         *  row updates to the database
         * @param RowUpdateGenerator $generator Generates single row updates
         *  based on the rows content
index 70afb91..59dcbd6 100644 (file)
@@ -41,8 +41,8 @@ class BatchRowWriter {
 
        /**
         * @param IDatabase $db The database to write to
-        * @param string       $table       The name of the table to update
-        * @param string|bool  $clusterName A cluster name valid for use with LBFactory
+        * @param string $table The name of the table to update
+        * @param string|bool $clusterName A cluster name valid for use with LBFactory
         */
        public function __construct( IDatabase $db, $table, $clusterName = false ) {
                $this->db = $db;
index 238fc98..cabea09 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,13 +2,19 @@
 <ruleset name="MediaWiki">
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude name="Generic.ControlStructures.InlineControlStructure" />
-               <!-- Disable rules added in 0.8.0 that don't pass yet -->
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Protected" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.Missing.Public" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
                <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamName" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfterParamType" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolReturn" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntReturn" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolParam" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntParam" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
                <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
                <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
                <exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
index 18e6e97..6a1f4b5 100644 (file)
@@ -1254,7 +1254,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @return Database[] Array of Database master connections
         */
-
        protected static function getExternalStoreDatabaseConnections() {
                global $wgDefaultExternalStore;