Merge "Improve documentation of constants throughout the codebase"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 12 Apr 2019 21:38:16 +0000 (21:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 12 Apr 2019 21:38:16 +0000 (21:38 +0000)
includes/MergeHistory.php
includes/block/Restriction/AbstractRestriction.php
includes/block/Restriction/Restriction.php
includes/media/DjVuImage.php
includes/search/SearchEngine.php
includes/search/SearchResultSet.php
includes/user/User.php
includes/watcheditem/NoWriteWatchedItemStore.php

index 0914a9b..6bd4471 100644 (file)
@@ -32,7 +32,7 @@ use Wikimedia\Rdbms\IDatabase;
  */
 class MergeHistory {
 
-       /** @const int Maximum number of revisions that can be merged at once */
+       /** Maximum number of revisions that can be merged at once */
        const REVISION_LIMIT = 5000;
 
        /** @var Title Page from which history will be merged */
index 7970266..a010e83 100644 (file)
@@ -25,12 +25,14 @@ namespace MediaWiki\Block\Restriction;
 abstract class AbstractRestriction implements Restriction {
 
        /**
-        * @var string
+        * String constant identifying the type of restriction. Expected to be overriden in subclasses
+        * with a non-empty string value.
         */
        const TYPE = '';
 
        /**
-        * @var int
+        * Numeric type identifier. Expected to be overriden in subclasses with a non-zero integer
+        * number. Must not exceed 127 to fit into a TINYINT database field.
         */
        const TYPE_ID = 0;
 
index fdf223a..d717fe7 100644 (file)
@@ -61,7 +61,7 @@ interface Restriction {
         * Gets the id of the type of restriction. This id is used in the database.
         *
         * @since 1.33
-        * @return string
+        * @return int
         */
        public static function getTypeId();
 
index 7189179..fde43f4 100644 (file)
@@ -36,8 +36,9 @@ use MediaWiki\Shell\Shell;
  * @ingroup Media
  */
 class DjVuImage {
+
        /**
-        * @const DJVUTXT_MEMORY_LIMIT Memory limit for the DjVu description software
+        * Memory limit for the DjVu description software
         */
        const DJVUTXT_MEMORY_LIMIT = 300000;
 
index 1f64dd4..a3a8abe 100644 (file)
@@ -56,16 +56,16 @@ abstract class SearchEngine {
        /** @var array Feature values */
        protected $features = [];
 
-       /** @const string profile type for completionSearch */
+       /** Profile type for completionSearch */
        const COMPLETION_PROFILE_TYPE = 'completionSearchProfile';
 
-       /** @const string profile type for query independent ranking features */
+       /** Profile type for query independent ranking features */
        const FT_QUERY_INDEP_PROFILE_TYPE = 'fulltextQueryIndepProfile';
 
-       /** @const int flag for legalSearchChars: includes all chars allowed in a search query */
+       /** Integer flag for legalSearchChars: includes all chars allowed in a search query */
        const CHARS_ALL = 1;
 
-       /** @const int flag for legalSearchChars: includes all chars allowed in a search term */
+       /** Integer flag for legalSearchChars: includes all chars allowed in a search term */
        const CHARS_NO_SYNTAX = 2;
 
        /**
index 2f1a5c2..18331dd 100644 (file)
  * @ingroup Search
  */
 class SearchResultSet implements Countable, IteratorAggregate {
+
        /**
-        * Types of interwiki results
-        */
-       /**
-        * Results that are displayed only together with existing main wiki results
-        * @var int
+        * Identifier for interwiki results that are displayed only together with existing main wiki
+        * results.
         */
        const SECONDARY_RESULTS = 0;
+
        /**
-        * Results that can displayed even if no existing main wiki results exist
-        * @var int
+        * Identifier for interwiki results that can be displayed even if no existing main wiki results
+        * exist.
         */
        const INLINE_RESULTS = 1;
 
index 5b07315..981204d 100644 (file)
@@ -46,18 +46,20 @@ use Wikimedia\Rdbms\IDatabase;
  * of the database.
  */
 class User implements IDBAccessObject, UserIdentity {
+
        /**
-        * @const int Number of characters in user_token field.
+        * Number of characters required for the user_token field.
         */
        const TOKEN_LENGTH = 32;
 
        /**
-        * @const string An invalid value for user_token
+        * An invalid string value for the user_token field.
         */
        const INVALID_TOKEN = '*** INVALID ***';
 
        /**
-        * @const int Serialized record version.
+        * Version number to tag cached versions of serialized User objects. Should be increased when
+        * {@link $mCacheVars} or one of it's members changes.
         */
        const VERSION = 13;
 
index 39d7a5d..fc95ebc 100644 (file)
@@ -32,9 +32,6 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
         */
        private $actualStore;
 
-       /**
-        * @var string
-        */
        const DB_READONLY_ERROR = 'The watchlist is currently readonly.';
 
        /**