Use ::class for class name resolution of EchoUserLocator

Also use namespaced class and AttributeManager::ATTR_LOCATORS
as seen in other extensions (like LoginNotify)

Change-Id: I183043ed91c20479b9594209341bf227507bb083
This commit is contained in:
Umherirrender 2024-06-19 21:46:01 +02:00
parent dfbd255b80
commit 2e491bfde1

View file

@ -2,7 +2,9 @@
namespace MediaWiki\Extension\OATHAuth\Hook; namespace MediaWiki\Extension\OATHAuth\Hook;
use MediaWiki\Extension\Notifications\AttributeManager;
use MediaWiki\Extension\Notifications\Hooks\BeforeCreateEchoEventHook; use MediaWiki\Extension\Notifications\Hooks\BeforeCreateEchoEventHook;
use MediaWiki\Extension\Notifications\UserLocator;
use MediaWiki\Extension\OATHAuth\Notifications\DisablePresentationModel; use MediaWiki\Extension\OATHAuth\Notifications\DisablePresentationModel;
use MediaWiki\Extension\OATHAuth\Notifications\EnablePresentationModel; use MediaWiki\Extension\OATHAuth\Notifications\EnablePresentationModel;
@ -31,7 +33,9 @@ class EchoHandler implements BeforeCreateEchoEventHook {
'section' => 'alert', 'section' => 'alert',
'presentation-model' => DisablePresentationModel::class, 'presentation-model' => DisablePresentationModel::class,
'canNotifyAgent' => true, 'canNotifyAgent' => true,
'user-locators' => [ 'EchoUserLocator::locateEventAgent' ], AttributeManager::ATTR_LOCATORS => [
[ [ UserLocator::class, 'locateEventAgent' ] ],
],
]; ];
$notifications['oathauth-enable'] = [ $notifications['oathauth-enable'] = [
@ -40,7 +44,9 @@ class EchoHandler implements BeforeCreateEchoEventHook {
'section' => 'alert', 'section' => 'alert',
'presentation-model' => EnablePresentationModel::class, 'presentation-model' => EnablePresentationModel::class,
'canNotifyAgent' => true, 'canNotifyAgent' => true,
'user-locators' => [ 'EchoUserLocator::locateEventAgent' ], AttributeManager::ATTR_LOCATORS => [
[ [ UserLocator::class, 'locateEventAgent' ] ],
],
]; ];
} }
} }