Remove unused service UserOptionsLookup from Definitions

Also use typed properties instead of @var types.

And rename $factory to $specialPageFactory.

Change-Id: I7fe5a8ad96e619019c1bbbb9143ad09174a9de5e
This commit is contained in:
Fomafix 2024-03-28 08:26:54 +00:00
parent 86fb2a8d18
commit 0dbe920285
2 changed files with 7 additions and 28 deletions

View file

@ -26,7 +26,6 @@ use MediaWiki\Minerva\Menu\Entries\SingleMenuEntry;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\SpecialPage\SpecialPageFactory;
use MediaWiki\Title\Title;
use MediaWiki\User\Options\UserOptionsLookup;
use MediaWiki\User\UserIdentity;
use Message;
@ -35,42 +34,23 @@ use Message;
*/
final class Definitions {
/**
* @var UserIdentity
*/
private $user;
/**
* @var IContextSource
*/
private $context;
/**
* @var SpecialPageFactory
*/
private $specialPageFactory;
/**
* @var UserOptionsLookup
*/
private $userOptionsLookup;
private UserIdentity $user;
private IContextSource $context;
private SpecialPageFactory $specialPageFactory;
/**
* Initialize definitions helper class
*
* @param IContextSource $context
* @param SpecialPageFactory $factory
* @param UserOptionsLookup $userOptionsLookup
* @param SpecialPageFactory $specialPageFactory
*/
public function __construct(
IContextSource $context,
SpecialPageFactory $factory,
UserOptionsLookup $userOptionsLookup
SpecialPageFactory $specialPageFactory
) {
$this->user = $context->getUser();
$this->context = $context;
$this->specialPageFactory = $factory;
$this->userOptionsLookup = $userOptionsLookup;
$this->specialPageFactory = $specialPageFactory;
}
/**

View file

@ -41,8 +41,7 @@ return [
'Minerva.Menu.Definitions' => static function ( MediaWikiServices $services ): Definitions {
return new Definitions(
RequestContext::getMain(),
$services->getSpecialPageFactory(),
$services->getUserOptionsLookup()
$services->getSpecialPageFactory()
);
},
'Minerva.Menu.UserMenuDirector' => static function ( MediaWikiServices $services ): UserMenuDirector {