mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-25 00:38:33 +00:00
Make Hooks::$tags a constant
Change-Id: I63bacc9bc6fc18ef677325439b6186d1813d23cf
This commit is contained in:
parent
ffbfbc0dd8
commit
6710b80d4f
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue