Convert some private static arrays to constants
Remove @since for some private ones as we don't guarantee anything about private class members. Change-Id: Ifb898353c02082e9ef69d67f69339345c6cd154d
This commit is contained in:
parent
f36901ab52
commit
8a98dd9d59
14 changed files with 67 additions and 69 deletions
|
|
@ -29,7 +29,7 @@ use Wikimedia\ParamValidator\ValidationException;
|
|||
class Validator {
|
||||
|
||||
/** @var array Type defs for ParamValidator */
|
||||
private static $typeDefs = [
|
||||
private const TYPE_DEFS = [
|
||||
'boolean' => [ 'class' => BooleanDef::class ],
|
||||
'enum' => [ 'class' => EnumDef::class ],
|
||||
'integer' => [ 'class' => IntegerDef::class ],
|
||||
|
|
@ -48,13 +48,13 @@ class Validator {
|
|||
];
|
||||
|
||||
/** @var string[] HTTP request methods that we expect never to have a payload */
|
||||
private static $noBodyMethods = [ 'GET', 'HEAD', 'DELETE' ];
|
||||
private const NO_BODY_METHODS = [ 'GET', 'HEAD', 'DELETE' ];
|
||||
|
||||
/** @var string[] HTTP request methods that we expect always to have a payload */
|
||||
private static $bodyMethods = [ 'POST', 'PUT' ];
|
||||
private const BODY_METHODS = [ 'POST', 'PUT' ];
|
||||
|
||||
/** @var string[] Content types handled via $_POST */
|
||||
private static $formDataContentTypes = [
|
||||
private const FORM_DATA_CONTENT_TYPES = [
|
||||
'application/x-www-form-urlencoded',
|
||||
'multipart/form-data',
|
||||
];
|
||||
|
|
@ -79,7 +79,7 @@ class Validator {
|
|||
new ParamValidatorCallbacks( $permissionManager, $request, $user ),
|
||||
$objectFactory,
|
||||
[
|
||||
'typeDefs' => self::$typeDefs,
|
||||
'typeDefs' => self::TYPE_DEFS,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ class Validator {
|
|||
$method = strtoupper( trim( $request->getMethod() ) );
|
||||
|
||||
// If the method should never have a body, don't bother validating.
|
||||
if ( in_array( $method, self::$noBodyMethods, true ) ) {
|
||||
if ( in_array( $method, self::NO_BODY_METHODS, true ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ class Validator {
|
|||
if ( $ct === '' ) {
|
||||
// No Content-Type was supplied. RFC 7231 § 3.1.1.5 allows this, but since it's probably a
|
||||
// client error let's return a 415. But don't 415 for unknown methods and an empty body.
|
||||
if ( !in_array( $method, self::$bodyMethods, true ) ) {
|
||||
if ( !in_array( $method, self::BODY_METHODS, true ) ) {
|
||||
$body = $request->getBody();
|
||||
$size = $body->getSize();
|
||||
if ( $size === null ) {
|
||||
|
|
@ -157,7 +157,7 @@ class Validator {
|
|||
|
||||
// Form data is parsed into $_POST and $_FILES by PHP and from there is accessed as parameters,
|
||||
// don't bother trying to handle these via BodyValidator too.
|
||||
if ( in_array( $ct, self::$formDataContentTypes, true ) ) {
|
||||
if ( in_array( $ct, self::FORM_DATA_CONTENT_TYPES, true ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface {
|
|||
*
|
||||
* @var array[]
|
||||
*/
|
||||
private static $transitions = [
|
||||
private const TRANSITIONS = [
|
||||
'new' => [
|
||||
'new' => true,
|
||||
'knows-current' => true,
|
||||
|
|
@ -338,7 +338,7 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface {
|
|||
* @throws LogicException If this instance is not in the expected stage
|
||||
*/
|
||||
private function assertTransition( $newStage ) {
|
||||
if ( empty( self::$transitions[$this->stage][$newStage] ) ) {
|
||||
if ( empty( self::TRANSITIONS[$this->stage][$newStage] ) ) {
|
||||
throw new LogicException( "Cannot transition from {$this->stage} to $newStage" );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class RecentChange implements Taggable {
|
|||
/**
|
||||
* @var array Array of change types
|
||||
*/
|
||||
private static $changeTypes = [
|
||||
private const CHANGE_TYPES = [
|
||||
'edit' => RC_EDIT,
|
||||
'new' => RC_NEW,
|
||||
'log' => RC_LOG,
|
||||
|
|
@ -158,10 +158,10 @@ class RecentChange implements Taggable {
|
|||
return $retval;
|
||||
}
|
||||
|
||||
if ( !array_key_exists( $type, self::$changeTypes ) ) {
|
||||
if ( !array_key_exists( $type, self::CHANGE_TYPES ) ) {
|
||||
throw new MWException( "Unknown type '$type'" );
|
||||
}
|
||||
return self::$changeTypes[$type];
|
||||
return self::CHANGE_TYPES[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -171,7 +171,7 @@ class RecentChange implements Taggable {
|
|||
* @return string $type
|
||||
*/
|
||||
public static function parseFromRCType( $rcType ) {
|
||||
return array_search( $rcType, self::$changeTypes, true ) ?: "$rcType";
|
||||
return array_search( $rcType, self::CHANGE_TYPES, true ) ?: "$rcType";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -182,7 +182,7 @@ class RecentChange implements Taggable {
|
|||
* @return array
|
||||
*/
|
||||
public static function getChangeTypes() {
|
||||
return array_keys( self::$changeTypes );
|
||||
return array_keys( self::CHANGE_TYPES );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class KafkaHandler extends AbstractProcessingHandler {
|
|||
/**
|
||||
* @var array defaults for constructor options
|
||||
*/
|
||||
private static $defaultOptions = [
|
||||
private const DEFAULT_OPTIONS = [
|
||||
'alias' => [], // map from monolog channel to kafka topic
|
||||
'swallowExceptions' => false, // swallow exceptions sending records
|
||||
'logExceptions' => null, // A PSR3 logger to inform about errors
|
||||
|
|
@ -83,7 +83,7 @@ class KafkaHandler extends AbstractProcessingHandler {
|
|||
) {
|
||||
parent::__construct( $level, $bubble );
|
||||
$this->produce = $produce;
|
||||
$this->options = array_merge( self::$defaultOptions, $options );
|
||||
$this->options = array_merge( self::DEFAULT_OPTIONS, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
protected $images = 0;
|
||||
|
||||
/** @var string[] Map of (table column => counter type) */
|
||||
private static $counters = [
|
||||
private const COUNTERS = [
|
||||
'ss_total_edits' => 'edits',
|
||||
'ss_total_pages' => 'pages',
|
||||
'ss_good_articles' => 'articles',
|
||||
|
|
@ -58,7 +58,7 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
Assert::parameterType( __CLASS__, $update, '$update' );
|
||||
'@phan-var SiteStatsUpdate $update';
|
||||
|
||||
foreach ( self::$counters as $field ) {
|
||||
foreach ( self::COUNTERS as $field ) {
|
||||
$this->$field += $update->$field;
|
||||
}
|
||||
}
|
||||
|
|
@ -72,12 +72,12 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
$update = new self( 0, 0, 0 );
|
||||
|
||||
foreach ( $deltas as $name => $unused ) {
|
||||
if ( !in_array( $name, self::$counters ) ) { // T187585
|
||||
if ( !in_array( $name, self::COUNTERS ) ) { // T187585
|
||||
throw new UnexpectedValueException( __METHOD__ . ": no field called '$name'" );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( self::$counters as $field ) {
|
||||
foreach ( self::COUNTERS as $field ) {
|
||||
$update->$field = $deltas[$field] ?? 0;
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
$stats = $services->getStatsdDataFactory();
|
||||
|
||||
$deltaByType = [];
|
||||
foreach ( self::$counters as $type ) {
|
||||
foreach ( self::COUNTERS as $type ) {
|
||||
$delta = $this->$type;
|
||||
if ( $delta !== 0 ) {
|
||||
$stats->updateCount( "site.$type", $delta );
|
||||
|
|
@ -102,7 +102,7 @@ class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
__METHOD__,
|
||||
function ( IDatabase $dbw, $fname ) use ( $deltaByType ) {
|
||||
$set = [];
|
||||
foreach ( self::$counters as $column => $type ) {
|
||||
foreach ( self::COUNTERS as $column => $type ) {
|
||||
$delta = (int)$deltaByType[$type];
|
||||
if ( $delta > 0 ) {
|
||||
$set[] = "$column=$column+" . abs( $delta );
|
||||
|
|
|
|||
|
|
@ -82,15 +82,15 @@ class FormatJson {
|
|||
* @note These are listed in ECMA-262 (5.1 Ed.), §7.3 Line Terminators along with U+000A (LF)
|
||||
* and U+000D (CR). However, PHP already escapes LF and CR according to RFC 4627.
|
||||
*/
|
||||
private static $badChars = [
|
||||
private const BAD_CHARS = [
|
||||
"\u{2028}", // U+2028 LINE SEPARATOR
|
||||
"\u{2029}", // U+2029 PARAGRAPH SEPARATOR
|
||||
];
|
||||
|
||||
/**
|
||||
* Escape sequences for characters listed in FormatJson::$badChars.
|
||||
* Escape sequences for characters listed in FormatJson::BAD_CHARS.
|
||||
*/
|
||||
private static $badCharsEscaped = [
|
||||
private const BAD_CHARS_ESCAPED = [
|
||||
'\u2028', // U+2028 LINE SEPARATOR
|
||||
'\u2029', // U+2029 PARAGRAPH SEPARATOR
|
||||
];
|
||||
|
|
@ -142,7 +142,7 @@ class FormatJson {
|
|||
}
|
||||
}
|
||||
if ( $escaping & self::UTF8_OK ) {
|
||||
$json = str_replace( self::$badChars, self::$badCharsEscaped, $json );
|
||||
$json = str_replace( self::BAD_CHARS, self::BAD_CHARS_ESCAPED, $json );
|
||||
}
|
||||
|
||||
return $json;
|
||||
|
|
|
|||
|
|
@ -35,10 +35,9 @@ class LanguageCode {
|
|||
* @var array Mapping from deprecated MediaWiki-internal language code
|
||||
* to replacement MediaWiki-internal language code.
|
||||
*
|
||||
* @since 1.30
|
||||
* @see https://meta.wikimedia.org/wiki/Special_language_codes
|
||||
*/
|
||||
private static $deprecatedLanguageCodeMapping = [
|
||||
private const DEPRECATED_LANGUAGE_CODE_MAPPING = [
|
||||
// Note that als is actually a valid ISO 639 code (Tosk Albanian), but it
|
||||
// was previously used in MediaWiki for Alsatian, which comes under gsw
|
||||
'als' => 'gsw', // T25215
|
||||
|
|
@ -74,11 +73,10 @@ class LanguageCode {
|
|||
* @var array Mapping from nonstandard MediaWiki-internal codes to
|
||||
* BCP 47 codes
|
||||
*
|
||||
* @since 1.32
|
||||
* @see https://meta.wikimedia.org/wiki/Special_language_codes
|
||||
* @see https://phabricator.wikimedia.org/T125073
|
||||
*/
|
||||
private static $nonstandardLanguageCodeMapping = [
|
||||
private const NON_STANDARD_LANGUAGE_CODE_MAPPING = [
|
||||
// All codes returned by Language::fetchLanguageNames() validated
|
||||
// against IANA registry at
|
||||
// https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
|
||||
|
|
@ -125,7 +123,7 @@ class LanguageCode {
|
|||
* @since 1.29
|
||||
*/
|
||||
public static function getDeprecatedCodeMapping() {
|
||||
return self::$deprecatedLanguageCodeMapping;
|
||||
return self::DEPRECATED_LANGUAGE_CODE_MAPPING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,10 +140,10 @@ class LanguageCode {
|
|||
*/
|
||||
public static function getNonstandardLanguageCodeMapping() {
|
||||
$result = [];
|
||||
foreach ( self::$deprecatedLanguageCodeMapping as $code => $ignore ) {
|
||||
foreach ( self::DEPRECATED_LANGUAGE_CODE_MAPPING as $code => $ignore ) {
|
||||
$result[$code] = self::bcp47( $code );
|
||||
}
|
||||
foreach ( self::$nonstandardLanguageCodeMapping as $code => $ignore ) {
|
||||
foreach ( self::NON_STANDARD_LANGUAGE_CODE_MAPPING as $code => $ignore ) {
|
||||
$result[$code] = self::bcp47( $code );
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -162,7 +160,7 @@ class LanguageCode {
|
|||
* @since 1.30
|
||||
*/
|
||||
public static function replaceDeprecatedCodes( $code ) {
|
||||
return self::$deprecatedLanguageCodeMapping[$code] ?? $code;
|
||||
return self::DEPRECATED_LANGUAGE_CODE_MAPPING[$code] ?? $code;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -177,8 +175,8 @@ class LanguageCode {
|
|||
*/
|
||||
public static function bcp47( $code ) {
|
||||
$code = self::replaceDeprecatedCodes( strtolower( $code ) );
|
||||
if ( isset( self::$nonstandardLanguageCodeMapping[$code] ) ) {
|
||||
$code = self::$nonstandardLanguageCodeMapping[$code];
|
||||
if ( isset( self::NON_STANDARD_LANGUAGE_CODE_MAPPING[$code] ) ) {
|
||||
$code = self::NON_STANDARD_LANGUAGE_CODE_MAPPING[$code];
|
||||
}
|
||||
$codeSegment = explode( '-', $code );
|
||||
$codeBCP = [];
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class MediaHandlerFactory {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $coreHandlers = [
|
||||
private const CORE_HANDLERS = [
|
||||
'image/jpeg' => JpegHandler::class,
|
||||
'image/png' => PNGHandler::class,
|
||||
'image/gif' => GIFHandler::class,
|
||||
|
|
@ -62,7 +62,7 @@ class MediaHandlerFactory {
|
|||
private $handlers;
|
||||
|
||||
public function __construct( array $registry ) {
|
||||
$this->registry = $registry + self::$coreHandlers;
|
||||
$this->registry = $registry + self::CORE_HANDLERS;
|
||||
}
|
||||
|
||||
protected function getHandlerClass( $type ) {
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class ParserOutput extends CacheTime {
|
|||
private $mFlags = [];
|
||||
|
||||
/** @var string[] */
|
||||
private static $speculativeFields = [
|
||||
private const SPECULATIVE_FIELDS = [
|
||||
'speculativePageIdUsed',
|
||||
'mSpeculativeRevId',
|
||||
'revisionTimestampUsed'
|
||||
|
|
@ -1354,7 +1354,7 @@ class ParserOutput extends CacheTime {
|
|||
$this->mWarnings = self::mergeMap( $this->mWarnings, $source->mWarnings ); // don't use getter
|
||||
$this->mTimestamp = $this->useMaxValue( $this->mTimestamp, $source->getTimestamp() );
|
||||
|
||||
foreach ( self::$speculativeFields as $field ) {
|
||||
foreach ( self::SPECULATIVE_FIELDS as $field ) {
|
||||
if ( $this->$field && $source->$field && $this->$field !== $source->$field ) {
|
||||
wfLogWarning( __METHOD__ . ": inconsistent '$field' properties!" );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class RemexStripTagHandler implements TokenHandler {
|
|||
// (although "block-level" is not technically defined for elements that are
|
||||
// new in HTML5).
|
||||
// Structured as tag => true to allow O(1) membership test.
|
||||
private static $BLOCK_LEVEL_TAGS = [
|
||||
private const BLOCK_LEVEL_TAGS = [
|
||||
'address' => true,
|
||||
'article' => true,
|
||||
'aside' => true,
|
||||
|
|
@ -112,6 +112,6 @@ class RemexStripTagHandler implements TokenHandler {
|
|||
*/
|
||||
private function isBlockLevelTag( $tagName ) {
|
||||
$key = strtolower( trim( $tagName ) );
|
||||
return isset( self::$BLOCK_LEVEL_TAGS[$key] );
|
||||
return isset( self::BLOCK_LEVEL_TAGS[$key] );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class Sanitizer {
|
|||
* https://www.w3.org/TR/html4/sgml/entities.html
|
||||
* As well as ' which is only defined starting in XHTML1.
|
||||
*/
|
||||
private static $htmlEntities = [
|
||||
private const HTML_ENTITIES = [
|
||||
'Aacute' => 193,
|
||||
'aacute' => 225,
|
||||
'Acirc' => 194,
|
||||
|
|
@ -337,7 +337,7 @@ class Sanitizer {
|
|||
/**
|
||||
* Character entity aliases accepted by MediaWiki
|
||||
*/
|
||||
private static $htmlEntityAliases = [
|
||||
private const HTML_ENTITY_ALIASES = [
|
||||
'רלמ' => 'rlm',
|
||||
'رلم' => 'rlm',
|
||||
];
|
||||
|
|
@ -1604,12 +1604,12 @@ class Sanitizer {
|
|||
* @return string
|
||||
*/
|
||||
static function normalizeEntity( $name ) {
|
||||
if ( isset( self::$htmlEntityAliases[$name] ) ) {
|
||||
return '&' . self::$htmlEntityAliases[$name] . ';';
|
||||
if ( isset( self::HTML_ENTITY_ALIASES[$name] ) ) {
|
||||
return '&' . self::HTML_ENTITY_ALIASES[$name] . ';';
|
||||
} elseif ( in_array( $name, [ 'lt', 'gt', 'amp', 'quot' ] ) ) {
|
||||
return "&$name;";
|
||||
} elseif ( isset( self::$htmlEntities[$name] ) ) {
|
||||
return '&#' . self::$htmlEntities[$name] . ';';
|
||||
} elseif ( isset( self::HTML_ENTITIES[$name] ) ) {
|
||||
return '&#' . self::HTML_ENTITIES[$name] . ';';
|
||||
} else {
|
||||
return "&$name;";
|
||||
}
|
||||
|
|
@ -1739,11 +1739,11 @@ class Sanitizer {
|
|||
* @return string
|
||||
*/
|
||||
static function decodeEntity( $name ) {
|
||||
if ( isset( self::$htmlEntityAliases[$name] ) ) {
|
||||
$name = self::$htmlEntityAliases[$name];
|
||||
if ( isset( self::HTML_ENTITY_ALIASES[$name] ) ) {
|
||||
$name = self::HTML_ENTITY_ALIASES[$name];
|
||||
}
|
||||
if ( isset( self::$htmlEntities[$name] ) ) {
|
||||
return UtfNormal\Utils::codepointToUtf8( self::$htmlEntities[$name] );
|
||||
if ( isset( self::HTML_ENTITIES[$name] ) ) {
|
||||
return UtfNormal\Utils::codepointToUtf8( self::HTML_ENTITIES[$name] );
|
||||
} else {
|
||||
return "&$name;";
|
||||
}
|
||||
|
|
@ -2065,7 +2065,7 @@ class Sanitizer {
|
|||
*/
|
||||
static function hackDocType() {
|
||||
$out = "<!DOCTYPE html [\n";
|
||||
foreach ( self::$htmlEntities as $entity => $codepoint ) {
|
||||
foreach ( self::HTML_ENTITIES as $entity => $codepoint ) {
|
||||
$out .= "<!ENTITY $entity \"&#$codepoint;\">";
|
||||
}
|
||||
$out .= "]>\n";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Argon2Password extends Password {
|
|||
/**
|
||||
* @var null[] Array with known password_hash() option names as keys
|
||||
*/
|
||||
private static $knownOptions = [
|
||||
private const KNOWN_OPTIONS = [
|
||||
'memory_cost' => null,
|
||||
'time_cost' => null,
|
||||
'threads' => null,
|
||||
|
|
@ -64,7 +64,7 @@ class Argon2Password extends Password {
|
|||
|
||||
}
|
||||
|
||||
$params = array_intersect_key( $this->config, self::$knownOptions );
|
||||
$params = array_intersect_key( $this->config, self::KNOWN_OPTIONS );
|
||||
|
||||
return [ $algo, $params ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use MediaWiki\Revision\RevisionRecord;
|
|||
*/
|
||||
class RevisionDeleter {
|
||||
/** List of known revdel types, with their corresponding list classes */
|
||||
private static $allowedTypes = [
|
||||
private const ALLOWED_TYPES = [
|
||||
'revision' => RevDelRevisionList::class,
|
||||
'archive' => RevDelArchiveList::class,
|
||||
'oldimage' => RevDelFileList::class,
|
||||
|
|
@ -39,7 +39,7 @@ class RevisionDeleter {
|
|||
];
|
||||
|
||||
/** Type map to support old log entries */
|
||||
private static $deprecatedTypeMap = [
|
||||
private const DEPRECATED_TYPE_MAP = [
|
||||
'oldid' => 'revision',
|
||||
'artimestamp' => 'archive',
|
||||
'oldimage' => 'oldimage',
|
||||
|
|
@ -54,7 +54,7 @@ class RevisionDeleter {
|
|||
* @return array
|
||||
*/
|
||||
public static function getTypes() {
|
||||
return array_keys( self::$allowedTypes );
|
||||
return array_keys( self::ALLOWED_TYPES );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,10 +65,10 @@ class RevisionDeleter {
|
|||
* @return string|null
|
||||
*/
|
||||
public static function getCanonicalTypeName( $typeName ) {
|
||||
if ( isset( self::$deprecatedTypeMap[$typeName] ) ) {
|
||||
$typeName = self::$deprecatedTypeMap[$typeName];
|
||||
if ( isset( self::DEPRECATED_TYPE_MAP[$typeName] ) ) {
|
||||
$typeName = self::DEPRECATED_TYPE_MAP[$typeName];
|
||||
}
|
||||
return isset( self::$allowedTypes[$typeName] ) ? $typeName : null;
|
||||
return isset( self::ALLOWED_TYPES[$typeName] ) ? $typeName : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -87,7 +87,7 @@ class RevisionDeleter {
|
|||
if ( !$typeName ) {
|
||||
throw new MWException( __METHOD__ . ": Unknown RevDel type '$typeName'" );
|
||||
}
|
||||
$class = self::$allowedTypes[$typeName];
|
||||
$class = self::ALLOWED_TYPES[$typeName];
|
||||
return new $class( $context, $title, $ids );
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ class RevisionDeleter {
|
|||
if ( !$typeName ) {
|
||||
return null;
|
||||
}
|
||||
return call_user_func( [ self::$allowedTypes[$typeName], 'getRelationType' ] );
|
||||
return call_user_func( [ self::ALLOWED_TYPES[$typeName], 'getRelationType' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -172,7 +172,7 @@ class RevisionDeleter {
|
|||
if ( !$typeName ) {
|
||||
return null;
|
||||
}
|
||||
return call_user_func( [ self::$allowedTypes[$typeName], 'getRestriction' ] );
|
||||
return call_user_func( [ self::ALLOWED_TYPES[$typeName], 'getRestriction' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,7 +186,7 @@ class RevisionDeleter {
|
|||
if ( !$typeName ) {
|
||||
return null;
|
||||
}
|
||||
return call_user_func( [ self::$allowedTypes[$typeName], 'getRevdelConstant' ] );
|
||||
return call_user_func( [ self::ALLOWED_TYPES[$typeName], 'getRevdelConstant' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -202,7 +202,7 @@ class RevisionDeleter {
|
|||
if ( !$typeName ) {
|
||||
return $target;
|
||||
}
|
||||
return call_user_func( [ self::$allowedTypes[$typeName], 'suggestTarget' ], $target, $ids );
|
||||
return call_user_func( [ self::ALLOWED_TYPES[$typeName], 'suggestTarget' ], $target, $ids );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
|
|||
/**
|
||||
* UI labels for each type.
|
||||
*/
|
||||
private static $UILabels = [
|
||||
private const UI_LABELS = [
|
||||
'revision' => [
|
||||
'check-label' => 'revdelete-hide-text',
|
||||
'success' => 'revdelete-success',
|
||||
|
|
@ -189,7 +189,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
|
|||
throw new UserBlockedError( $user->getBlock() );
|
||||
}
|
||||
|
||||
$this->typeLabels = self::$UILabels[$this->typeName];
|
||||
$this->typeLabels = self::UI_LABELS[$this->typeName];
|
||||
$list = $this->getList();
|
||||
$list->reset();
|
||||
$this->mIsAllowed = $this->permissionManager->userHasRight( $user,
|
||||
|
|
|
|||
Loading…
Reference in a new issue