Use type hint UserOptionsLookup for private variable declaration

Also use alphabetical order of the __constuct parameters.

Change-Id: I448103eabdb88372709eb529118f0f5d17baee8a
This commit is contained in:
Fomafix 2023-10-23 20:14:57 +00:00
parent dee4a7e067
commit 72745a5f28
3 changed files with 9 additions and 12 deletions

View file

@ -425,8 +425,8 @@
"main": {
"class": "MediaWiki\\Extension\\MultimediaViewer\\Hooks",
"services": [
"UserOptionsLookup",
"SpecialPageFactory"
"SpecialPageFactory",
"UserOptionsLookup"
]
}
},

View file

@ -63,22 +63,19 @@ class Hooks implements
protected static $helpLink =
'https://mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Media_Viewer';
/**
* @var UserOptionsLookup
*/
private $userOptionsLookup;
private SpecialPageFactory $specialPageFactory;
private UserOptionsLookup $userOptionsLookup;
/**
* @param UserOptionsLookup $userOptionsLookup
* @param SpecialPageFactory $specialPageFactory
* @param UserOptionsLookup $userOptionsLookup
*/
public function __construct(
UserOptionsLookup $userOptionsLookup,
SpecialPageFactory $specialPageFactory
SpecialPageFactory $specialPageFactory,
UserOptionsLookup $userOptionsLookup
) {
$this->userOptionsLookup = $userOptionsLookup;
$this->specialPageFactory = $specialPageFactory;
$this->userOptionsLookup = $userOptionsLookup;
}
/**

View file

@ -15,8 +15,8 @@ class HooksTest extends MediaWikiIntegrationTestCase {
public function newHooksInstance() {
return new Hooks(
$this->getServiceContainer()->getUserOptionsLookup(),
$this->getServiceContainer()->getSpecialPageFactory()
$this->getServiceContainer()->getSpecialPageFactory(),
$this->getServiceContainer()->getUserOptionsLookup()
);
}