diff options
author | Reedy <reedy@wikimedia.org> | 2020-05-12 22:42:08 +0100 |
---|---|---|
committer | Reedy <reedy@wikimedia.org> | 2020-05-15 00:32:23 +0100 |
commit | c50ba9b190dde30e034ccaef42d9aed3383ba4e2 (patch) | |
tree | f031d0e5f0b5ad6fbcf5902b56dd3eb39dbd0f25 | |
parent | 411d927d4dda316fec7d68d9229374f2cfb5a1ed (diff) | |
download | mediawikicore-c50ba9b190dde30e034ccaef42d9aed3383ba4e2.tar.gz mediawikicore-c50ba9b190dde30e034ccaef42d9aed3383ba4e2.zip |
Fix more PSR12.Properties.ConstantVisibility.NotFound
Change-Id: I0ccda3d1de29b1044f74ef0972949eb8fbcb707d
-rw-r--r-- | .phpcs.xml | 6 | ||||
-rw-r--r-- | includes/Revision/RevisionStore.php | 2 | ||||
-rw-r--r-- | includes/Revision/SlotRecord.php | 2 | ||||
-rw-r--r-- | includes/actions/HistoryAction.php | 4 | ||||
-rw-r--r-- | includes/actions/InfoAction.php | 2 | ||||
-rw-r--r-- | includes/deferred/CdnCacheUpdate.php | 2 | ||||
-rw-r--r-- | includes/deferred/DeferredUpdates.php | 8 | ||||
-rw-r--r-- | includes/deferred/TransactionRoundAwareUpdate.php | 4 | ||||
-rw-r--r-- | includes/site/MediaWikiSite.php | 4 | ||||
-rw-r--r-- | includes/site/Site.php | 16 | ||||
-rw-r--r-- | includes/site/SiteList.php | 2 | ||||
-rw-r--r-- | includes/specials/SpecialEditWatchlist.php | 6 | ||||
-rw-r--r-- | includes/specials/SpecialExpandTemplates.php | 2 | ||||
-rw-r--r-- | includes/specials/SpecialMute.php | 2 | ||||
-rw-r--r-- | includes/specials/SpecialSearch.php | 2 | ||||
-rw-r--r-- | includes/specials/SpecialUploadStash.php | 2 | ||||
-rw-r--r-- | includes/watcheditem/NoWriteWatchedItemStore.php | 2 | ||||
-rw-r--r-- | includes/watcheditem/WatchedItemStoreInterface.php | 4 |
18 files changed, 33 insertions, 39 deletions
diff --git a/.phpcs.xml b/.phpcs.xml index f48d1d31f042..1c4fa2ffe581 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -21,14 +21,11 @@ <rule ref="PSR12.Properties.ConstantVisibility.NotFound"> <exclude-pattern>includes/FormOptions\.php</exclude-pattern> <exclude-pattern>includes/Rest/</exclude-pattern> - <exclude-pattern>includes/Revision/</exclude-pattern> <exclude-pattern>includes/Storage/</exclude-pattern> - <exclude-pattern>includes/actions/</exclude-pattern> <exclude-pattern>includes/api/</exclude-pattern> <exclude-pattern>includes/block/</exclude-pattern> <exclude-pattern>includes/cache/</exclude-pattern> <exclude-pattern>includes/changes/</exclude-pattern> - <exclude-pattern>includes/deferred/</exclude-pattern> <exclude-pattern>includes/diff/</exclude-pattern> <exclude-pattern>includes/exception/</exclude-pattern> <exclude-pattern>includes/filerepo/</exclude-pattern> @@ -43,11 +40,8 @@ <exclude-pattern>includes/poolcounter/</exclude-pattern> <exclude-pattern>includes/resourceloader/</exclude-pattern> <exclude-pattern>includes/search/</exclude-pattern> - <exclude-pattern>includes/site/</exclude-pattern> - <exclude-pattern>includes/specials/</exclude-pattern> <exclude-pattern>includes/user/</exclude-pattern> <exclude-pattern>includes/utils/</exclude-pattern> - <exclude-pattern>includes/watcheditem/</exclude-pattern> <exclude-pattern>languages/</exclude-pattern> <exclude-pattern>tests/phpunit/includes/</exclude-pattern> </rule> diff --git a/includes/Revision/RevisionStore.php b/includes/Revision/RevisionStore.php index e3d8cf253a49..173731ad9e68 100644 --- a/includes/Revision/RevisionStore.php +++ b/includes/Revision/RevisionStore.php @@ -78,7 +78,7 @@ use Wikimedia\Rdbms\IResultWrapper; class RevisionStore implements IDBAccessObject, RevisionFactory, RevisionLookup, LoggerAwareInterface { - const ROW_CACHE_KEY = 'revision-row-1.29'; + public const ROW_CACHE_KEY = 'revision-row-1.29'; /** * @var SqlBlobStore diff --git a/includes/Revision/SlotRecord.php b/includes/Revision/SlotRecord.php index 7465f790005b..1cf6d821fdac 100644 --- a/includes/Revision/SlotRecord.php +++ b/includes/Revision/SlotRecord.php @@ -38,7 +38,7 @@ use Wikimedia\Assert\Assert; */ class SlotRecord { - const MAIN = 'main'; + public const MAIN = 'main'; /** * @var object database result row, as a raw object. Callbacks are supported for field values, diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index a544654905f8..31fbe1c7d01a 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -36,8 +36,8 @@ use Wikimedia\Rdbms\IResultWrapper; * @ingroup Actions */ class HistoryAction extends FormlessAction { - const DIR_PREV = 0; - const DIR_NEXT = 1; + private const DIR_PREV = 0; + private const DIR_NEXT = 1; /** @var array Array of message keys and strings */ public $message; diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index e4a326a06cde..47adca0c32c3 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -32,7 +32,7 @@ use Wikimedia\Rdbms\Database; * @ingroup Actions */ class InfoAction extends FormlessAction { - const VERSION = 1; + private const VERSION = 1; /** * Returns the name of the action this object responds to. diff --git a/includes/deferred/CdnCacheUpdate.php b/includes/deferred/CdnCacheUpdate.php index fc0c77d5d5c4..0c4578830495 100644 --- a/includes/deferred/CdnCacheUpdate.php +++ b/includes/deferred/CdnCacheUpdate.php @@ -32,7 +32,7 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate { private $titleTuples = []; /** @var int Maximum seconds of rebound purge delay (sanity) */ - const MAX_REBOUND_DELAY = 300; + private const MAX_REBOUND_DELAY = 300; /** * @param string[]|Title[] $targets Collection of URLs/titles to be purged from CDN diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 09e245c03c25..1f0271011908 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -80,11 +80,11 @@ class DeferredUpdates { */ private static $executionStack = []; - const ALL = 0; // all updates; in web requests, use only after flushing the output buffer - const PRESEND = 1; // for updates that should run before flushing output buffer - const POSTSEND = 2; // for updates that should run after flushing output buffer + public const ALL = 0; // all updates; in web requests, use only after flushing the output buffer + public const PRESEND = 1; // for updates that should run before flushing output buffer + public const POSTSEND = 2; // for updates that should run after flushing output buffer - const BIG_QUEUE_SIZE = 100; + private const BIG_QUEUE_SIZE = 100; /** * Add an update to the deferred update queue for execution at the appropriate time diff --git a/includes/deferred/TransactionRoundAwareUpdate.php b/includes/deferred/TransactionRoundAwareUpdate.php index ccb59e5a6978..e0ffee64cb52 100644 --- a/includes/deferred/TransactionRoundAwareUpdate.php +++ b/includes/deferred/TransactionRoundAwareUpdate.php @@ -8,9 +8,9 @@ */ interface TransactionRoundAwareUpdate { /** @var int No explicit transaction round should be used */ - const TRX_ROUND_ABSENT = 1; + public const TRX_ROUND_ABSENT = 1; /** @var int An explicit transaction round owned by self::doUpdate should be used */ - const TRX_ROUND_PRESENT = 2; + public const TRX_ROUND_PRESENT = 2; /** * @return int One of the class TRX_ROUND_* constants diff --git a/includes/site/MediaWikiSite.php b/includes/site/MediaWikiSite.php index 6a117f4aab39..25c980012766 100644 --- a/includes/site/MediaWikiSite.php +++ b/includes/site/MediaWikiSite.php @@ -36,8 +36,8 @@ use MediaWiki\Site\MediaWikiPageNameNormalizer; * @ingroup Site */ class MediaWikiSite extends Site { - const PATH_FILE = 'file_path'; - const PATH_PAGE = 'page_path'; + public const PATH_FILE = 'file_path'; + public const PATH_PAGE = 'page_path'; /** * @since 1.21 diff --git a/includes/site/Site.php b/includes/site/Site.php index 4eb06c287e99..44aa2e91a4c1 100644 --- a/includes/site/Site.php +++ b/includes/site/Site.php @@ -29,17 +29,17 @@ use MediaWiki\MediaWikiServices; * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ class Site implements Serializable { - const TYPE_UNKNOWN = 'unknown'; - const TYPE_MEDIAWIKI = 'mediawiki'; + public const TYPE_UNKNOWN = 'unknown'; + public const TYPE_MEDIAWIKI = 'mediawiki'; - const GROUP_NONE = 'none'; + public const GROUP_NONE = 'none'; - const ID_INTERWIKI = 'interwiki'; - const ID_EQUIVALENT = 'equivalent'; + public const ID_INTERWIKI = 'interwiki'; + public const ID_EQUIVALENT = 'equivalent'; - const SOURCE_LOCAL = 'local'; + public const SOURCE_LOCAL = 'local'; - const PATH_LINK = 'link'; + public const PATH_LINK = 'link'; /** * A version ID that identifies the serialization structure used by getSerializationData() @@ -48,7 +48,7 @@ class Site implements Serializable { * * @var string A string uniquely identifying the version of the serialization structure. */ - const SERIAL_VERSION_ID = '2013-01-23'; + public const SERIAL_VERSION_ID = '2013-01-23'; /** * @since 1.21 diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index 726ab46837fe..04212dc4ac01 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -296,7 +296,7 @@ class SiteList extends GenericArrayObject { * @var string A string uniquely identifying the version of the serialization structure, * not including any sub-structures. */ - const SERIAL_VERSION_ID = '2014-03-17'; + private const SERIAL_VERSION_ID = '2014-03-17'; /** * Returns the version ID that identifies the serialization structure used by diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index c2b3939be162..e196a8fdfbbc 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -43,9 +43,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { * Editing modes. EDIT_CLEAR is no longer used; the "Clear" link scared people * too much. Now it's passed on to the raw editor, from which it's very easy to clear. */ - const EDIT_CLEAR = 1; - const EDIT_RAW = 2; - const EDIT_NORMAL = 3; + public const EDIT_CLEAR = 1; + public const EDIT_RAW = 2; + public const EDIT_NORMAL = 3; protected $successMessage; diff --git a/includes/specials/SpecialExpandTemplates.php b/includes/specials/SpecialExpandTemplates.php index 4b365dcba380..7e1ab7881fc8 100644 --- a/includes/specials/SpecialExpandTemplates.php +++ b/includes/specials/SpecialExpandTemplates.php @@ -44,7 +44,7 @@ class SpecialExpandTemplates extends SpecialPage { protected $removeNowiki; /** @var int Maximum size in bytes to include. 50MB allows fixing those huge pages */ - const MAX_INCLUDE_SIZE = 50000000; + private const MAX_INCLUDE_SIZE = 50000000; function __construct() { parent::__construct( 'ExpandTemplates' ); diff --git a/includes/specials/SpecialMute.php b/includes/specials/SpecialMute.php index d37cad227d1d..7f675d24c1a6 100644 --- a/includes/specials/SpecialMute.php +++ b/includes/specials/SpecialMute.php @@ -28,7 +28,7 @@ use MediaWiki\Preferences\MultiUsernameFilter; */ class SpecialMute extends FormSpecialPage { - const PAGE_NAME = 'Mute'; + private const PAGE_NAME = 'Mute'; /** @var User */ private $target; diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 88d2be3b82d6..3daaa1ebddd0 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -98,7 +98,7 @@ class SpecialSearch extends SpecialPage { */ private $loadStatus; - const NAMESPACES_CURRENT = 'sense'; + private const NAMESPACES_CURRENT = 'sense'; public function __construct() { parent::__construct( 'Search' ); diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index ba1a3332e108..50e63ffea67b 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -49,7 +49,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * This service is really for thumbnails and other such previews while * uploading. */ - const MAX_SERVE_BYTES = 1048576; // 1MB + private const MAX_SERVE_BYTES = 1048576; // 1MB public function __construct() { parent::__construct( 'UploadStash', 'upload' ); diff --git a/includes/watcheditem/NoWriteWatchedItemStore.php b/includes/watcheditem/NoWriteWatchedItemStore.php index 4507ab19ea7f..62a6d5e00ad0 100644 --- a/includes/watcheditem/NoWriteWatchedItemStore.php +++ b/includes/watcheditem/NoWriteWatchedItemStore.php @@ -34,7 +34,7 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { */ private $actualStore; - const DB_READONLY_ERROR = 'The watchlist is currently readonly.'; + private const DB_READONLY_ERROR = 'The watchlist is currently readonly.'; /** * Initialy set WatchedItemStore that will be used in cases where writing is not needed. diff --git a/includes/watcheditem/WatchedItemStoreInterface.php b/includes/watcheditem/WatchedItemStoreInterface.php index 6ab663b58257..b8d27557bc8c 100644 --- a/includes/watcheditem/WatchedItemStoreInterface.php +++ b/includes/watcheditem/WatchedItemStoreInterface.php @@ -32,12 +32,12 @@ interface WatchedItemStoreInterface { /** * @since 1.31 */ - const SORT_ASC = 'ASC'; + public const SORT_ASC = 'ASC'; /** * @since 1.31 */ - const SORT_DESC = 'DESC'; + public const SORT_DESC = 'DESC'; /** * Count the number of individual items that are watched by the user. |