Fix numerous PSR12.Properties.ConstantVisibility.NotFound

Change-Id: I157220c4e9ff516283a60f06af99efa2439332e3
This commit is contained in:
Reedy 2020-05-11 01:48:27 +01:00
parent b213a54efc
commit a8467a0fd7
17 changed files with 31 additions and 52 deletions

View file

@ -19,25 +19,10 @@
</rule>
<!-- TODO Still to be done -->
<rule ref="PSR12.Properties.ConstantVisibility.NotFound">
<exclude-pattern>includes/ActorMigration\.php</exclude-pattern>
<exclude-pattern>includes/CategoriesRdf\.php</exclude-pattern>
<exclude-pattern>includes/Category\.php</exclude-pattern>
<exclude-pattern>includes/CommentStore\.php</exclude-pattern>
<exclude-pattern>includes/ContentSecurityPolicy\.php</exclude-pattern>
<exclude-pattern>includes/ForkController\.php</exclude-pattern>
<exclude-pattern>includes/FormOptions\.php</exclude-pattern>
<exclude-pattern>includes/LinkFilter\.php</exclude-pattern>
<exclude-pattern>includes/Linker\.php</exclude-pattern>
<exclude-pattern>includes/MediaWiki\.php</exclude-pattern>
<exclude-pattern>includes/MergeHistory\.php</exclude-pattern>
<exclude-pattern>includes/PageProps\.php</exclude-pattern>
<exclude-pattern>includes/Pingback\.php</exclude-pattern>
<exclude-pattern>includes/Rest/</exclude-pattern>
<exclude-pattern>includes/Revision/</exclude-pattern>
<exclude-pattern>includes/Storage/</exclude-pattern>
<exclude-pattern>includes/StreamFile\.php</exclude-pattern>
<exclude-pattern>includes/Title\.php</exclude-pattern>
<exclude-pattern>includes/WebRequest\.php</exclude-pattern>
<exclude-pattern>includes/actions/</exclude-pattern>
<exclude-pattern>includes/api/</exclude-pattern>
<exclude-pattern>includes/block/</exclude-pattern>

View file

@ -552,6 +552,7 @@ because of Phabricator reports.
* The wfIsHHVM global function, deprecated in 1.34, was removed.
* GenderCache::doTitlesArray no longer accepts string values in its $titles
array parameter. Use Title objects (or other LinkTarget) instead.
* Unused CommentStore::MAX_COMMENT_LENGTH has been removed.
* …
=== Deprecations in 1.35 ===

View file

@ -41,7 +41,7 @@ class ActorMigration {
* Constant for extensions to feature-test whether $wgActorTableSchemaMigrationStage
* (in MW <1.34) expects MIGRATION_* or SCHEMA_COMPAT_*
*/
const MIGRATION_STAGE_SCHEMA_COMPAT = 1;
public const MIGRATION_STAGE_SCHEMA_COMPAT = 1;
/**
* Define fields that use temporary tables for transitional purposes

View file

@ -25,25 +25,25 @@ class CategoriesRdf {
/**
* Prefix used for Mediawiki ontology in the dump.
*/
const ONTOLOGY_PREFIX = 'mediawiki';
private const ONTOLOGY_PREFIX = 'mediawiki';
/**
* Base URL for Mediawiki ontology.
*/
const ONTOLOGY_URL = 'https://www.mediawiki.org/ontology#';
private const ONTOLOGY_URL = 'https://www.mediawiki.org/ontology#';
/**
* OWL description of the ontology.
*/
const OWL_URL = 'https://www.mediawiki.org/ontology/ontology.owl';
public const OWL_URL = 'https://www.mediawiki.org/ontology/ontology.owl';
/**
* Current version of the dump format.
*/
const FORMAT_VERSION = "1.1";
public const FORMAT_VERSION = "1.1";
/**
* Special page for Dump identification.
* Used as head URI for each wiki's category dump, e.g.:
* https://en.wikipedia.org/wiki/Special:CategoryDump
*/
const SPECIAL_DUMP = 'Special:CategoryDump';
private const SPECIAL_DUMP = 'Special:CategoryDump';
/**
* @var RdfWriter
*/

View file

@ -38,10 +38,10 @@ class Category {
/** Counts of membership (cat_pages, cat_subcats, cat_files) */
private $mPages = null, $mSubcats = null, $mFiles = null;
const LOAD_ONLY = 0;
const LAZY_INIT_ROW = 1;
protected const LOAD_ONLY = 0;
protected const LAZY_INIT_ROW = 1;
const ROW_COUNT_SMALL = 100;
public const ROW_COUNT_SMALL = 100;
private function __construct() {
}

View file

@ -32,23 +32,16 @@ class CommentStore {
/**
* Maximum length of a comment in UTF-8 characters. Longer comments will be truncated.
* @note This must be at least 255 and not greater than floor( MAX_COMMENT_LENGTH / 4 ).
* @note This must be at least 255 and not greater than floor( MAX_DATA_LENGTH / 4 ).
*/
const COMMENT_CHARACTER_LIMIT = 500;
/**
* Maximum length of a comment in bytes. Longer comments will be truncated.
* @note This value is determined by the size of the underlying database field,
* currently BLOB in MySQL/MariaDB.
*/
const MAX_COMMENT_LENGTH = 65535;
public const COMMENT_CHARACTER_LIMIT = 500;
/**
* Maximum length of serialized data in bytes. Longer data will result in an exception.
* @note This value is determined by the size of the underlying database field,
* currently BLOB in MySQL/MariaDB.
*/
const MAX_DATA_LENGTH = 65535;
public const MAX_DATA_LENGTH = 65535;
/**
* Define fields that use temporary tables for transitional purposes

View file

@ -28,8 +28,8 @@
use MediaWiki\MediaWikiServices;
class ContentSecurityPolicy {
const REPORT_ONLY_MODE = 1;
const FULL_MODE = 2;
public const REPORT_ONLY_MODE = 1;
public const FULL_MODE = 2;
/** @var string The nonce to use for inline scripts (from OutputPage) */
private $nonce;

View file

@ -51,7 +51,7 @@ class ForkController {
* Pass this flag to __construct() to cause the class to automatically restart
* workers that exit with non-zero exit status or a signal such as SIGSEGV.
*/
const RESTART_ON_ERROR = 1;
private const RESTART_ON_ERROR = 1;
public function __construct( $numProcs, $flags = 0 ) {
if ( !wfIsCLI() ) {

View file

@ -38,7 +38,7 @@ class LinkFilter {
* Increment this when makeIndexes output changes. It'll cause
* maintenance/refreshExternallinksIndex.php to run from update.php.
*/
const VERSION = 1;
public const VERSION = 1;
/**
* Check whether $content contains a link to $filterEntry

View file

@ -37,8 +37,8 @@ class Linker {
/**
* Flags for userToolLinks()
*/
const TOOL_LINKS_NOBLOCK = 1;
const TOOL_LINKS_EMAIL = 2;
public const TOOL_LINKS_NOBLOCK = 1;
public const TOOL_LINKS_EMAIL = 2;
/**
* This function returns an HTML link to the given target. It serves a few

View file

@ -44,9 +44,9 @@ class MediaWiki {
private $postSendStrategy;
/** @var int Use fastcgi_finish_request() */
const DEFER_FASTCGI_FINISH_REQUEST = 1;
private const DEFER_FASTCGI_FINISH_REQUEST = 1;
/** @var int Use ob_end_flush() after explicitly setting the Content-Length */
const DEFER_SET_LENGTH_AND_FLUSH = 2;
private const DEFER_SET_LENGTH_AND_FLUSH = 2;
/**
* @param IContextSource|null $context

View file

@ -35,7 +35,7 @@ use Wikimedia\Timestamp\TimestampException;
class MergeHistory {
/** Maximum number of revisions that can be merged at once */
const REVISION_LIMIT = 5000;
public const REVISION_LIMIT = 5000;
/** @var Title Page from which history will be merged */
protected $source;

View file

@ -71,8 +71,8 @@ class PageProps {
}
/** Cache parameters */
const CACHE_TTL = 10; // integer; TTL in seconds
const CACHE_SIZE = 100; // integer; max cached pages
private const CACHE_TTL = 10; // integer; TTL in seconds
private const CACHE_SIZE = 100; // integer; max cached pages
/** Property cache */
private $cache = null;

View file

@ -36,7 +36,7 @@ class Pingback {
* payload. The schema lives on MetaWiki, at
* <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>.
*/
const SCHEMA_REV = 15781718;
private const SCHEMA_REV = 15781718;
/** @var LoggerInterface */
protected $logger;

View file

@ -26,10 +26,10 @@
class StreamFile {
// Do not send any HTTP headers unless requested by caller (e.g. body only)
/** @deprecated since 1.34 */
const STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS;
public const STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS;
// Do not try to tear down any PHP output buffers
/** @deprecated since 1.34 */
const STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB;
public const STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB;
/**
* Stream a file to the browser, adding all the headings and fun stuff.

View file

@ -48,14 +48,14 @@ class Title implements LinkTarget, IDBAccessObject {
* commonly used titles. On a batch operation this can become a memory leak
* if not bounded. After hitting this many titles reset the cache.
*/
const CACHE_MAX = 1000;
private const CACHE_MAX = 1000;
/**
* Used to be GAID_FOR_UPDATE define(). Used with getArticleID() and friends
* to use the master DB and inject it into link cache.
* @deprecated since 1.34, use Title::READ_LATEST instead.
*/
const GAID_FOR_UPDATE = 512;
public const GAID_FOR_UPDATE = 512;
/**
* Flag for use with factory methods like newFromLinkTarget() that have
@ -64,7 +64,7 @@ class Title implements LinkTarget, IDBAccessObject {
*
* @since 1.33
*/
const NEW_CLONE = 'clone';
public const NEW_CLONE = 'clone';
/**
* @name Private member variables

View file

@ -69,7 +69,7 @@ class WebRequest {
* Flag to make WebRequest::getHeader return an array of values.
* @since 1.26
*/
const GETHEADER_LIST = 1;
public const GETHEADER_LIST = 1;
/**
* The unique request ID.