Make Hooks::$tags a constant

Change-Id: I63bacc9bc6fc18ef677325439b6186d1813d23cf
This commit is contained in:
Ed Sanders 2020-12-16 16:17:22 +00:00 committed by Bartosz Dziewoński
parent ffbfbc0dd8
commit 6710b80d4f

View file

@ -27,7 +27,7 @@ use WebRequest;
class Hooks { class Hooks {
private static $tags = [ private const TAGS = [
'discussiontools', 'discussiontools',
// Features: // Features:
'discussiontools-reply', 'discussiontools-reply',
@ -319,7 +319,7 @@ class Hooks {
* @param array &$tags Available change tags. * @param array &$tags Available change tags.
*/ */
public static function onListDefinedTags( array &$tags ) : void { public static function onListDefinedTags( array &$tags ) : void {
$tags = array_merge( $tags, static::$tags ); $tags = array_merge( $tags, static::TAGS );
} }
/** /**
@ -338,7 +338,7 @@ class Hooks {
$request = RequestContext::getMain()->getRequest(); $request = RequestContext::getMain()->getRequest();
$tags = explode( ',', $request->getVal( 'dttags' ) ); $tags = explode( ',', $request->getVal( 'dttags' ) );
$tags = array_values( array_intersect( $tags, static::$tags ) ); $tags = array_values( array_intersect( $tags, static::TAGS ) );
if ( $tags ) { if ( $tags ) {
$recentChange->addTags( $tags ); $recentChange->addTags( $tags );