mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 08:00:32 +00:00
Merge "Hygiene: Rename MainMenu related classes"
This commit is contained in:
commit
01ca1602e1
|
@ -22,7 +22,9 @@
|
|||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Minerva\LanguagesHelper;
|
||||
use MediaWiki\Minerva\Menu\Definitions;
|
||||
use MediaWiki\Minerva\Menu\Main as MainMenu;
|
||||
use MediaWiki\Minerva\Menu\Main\MainMenuDirector;
|
||||
use MediaWiki\Minerva\Menu\Main\DefaultMainMenuBuilder;
|
||||
use MediaWiki\Minerva\Menu\Main\AdvancedMainMenuBuilder;
|
||||
use MediaWiki\Minerva\Menu\PageActions as PageActionsMenu;
|
||||
use MediaWiki\Minerva\Menu\User\AdvancedUserMenuBuilder;
|
||||
use MediaWiki\Minerva\Menu\User\DefaultUserMenuBuilder;
|
||||
|
@ -55,7 +57,7 @@ return [
|
|||
$context->getSkin()
|
||||
);
|
||||
},
|
||||
'Minerva.Menu.MainDirector' => function ( MediaWikiServices $services ): MainMenu\Director {
|
||||
'Minerva.Menu.MainDirector' => function ( MediaWikiServices $services ): MainMenuDirector {
|
||||
$context = RequestContext::getMain();
|
||||
/** @var SkinOptions $options */
|
||||
$options = $services->getService( 'Minerva.SkinOptions' );
|
||||
|
@ -63,10 +65,10 @@ return [
|
|||
$showMobileOptions = $options->get( SkinOptions::MOBILE_OPTIONS );
|
||||
$user = $context->getUser();
|
||||
$builder = $options->get( SkinOptions::AMC_MODE ) ?
|
||||
new MainMenu\AdvancedBuilder( $showMobileOptions, $user, $definitions ) :
|
||||
new MainMenu\DefaultBuilder( $showMobileOptions, $user, $definitions );
|
||||
new AdvancedMainMenuBuilder( $showMobileOptions, $user, $definitions ) :
|
||||
new DefaultMainMenuBuilder( $showMobileOptions, $user, $definitions );
|
||||
|
||||
return new MainMenu\Director( $builder, $context, $services->getSpecialPageFactory() );
|
||||
return new MainMenuDirector( $builder, $context, $services->getSpecialPageFactory() );
|
||||
},
|
||||
'Minerva.Menu.PageActionsDirector' =>
|
||||
function ( MediaWikiServices $services ): PageActionsMenu\PageActionsDirector {
|
||||
|
|
|
@ -34,7 +34,7 @@ use MediaWiki\Minerva\Menu\Group;
|
|||
*
|
||||
* @package MediaWiki\Minerva\Menu\Main
|
||||
*/
|
||||
final class AdvancedBuilder implements IBuilder {
|
||||
final class AdvancedMainMenuBuilder implements IMainMenuBuilder {
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
|
@ -30,7 +30,7 @@ use MediaWiki\Minerva\Menu\Group;
|
|||
/**
|
||||
* Used to build default (available for everyone by default) main menu
|
||||
*/
|
||||
final class DefaultBuilder implements IBuilder {
|
||||
final class DefaultMainMenuBuilder implements IMainMenuBuilder {
|
||||
|
||||
/**
|
||||
* @var bool
|
|
@ -22,7 +22,7 @@ namespace MediaWiki\Minerva\Menu\Main;
|
|||
|
||||
use MediaWiki\Minerva\Menu\Group;
|
||||
|
||||
interface IBuilder {
|
||||
interface IMainMenuBuilder {
|
||||
|
||||
/**
|
||||
* @return Group[]
|
|
@ -28,10 +28,10 @@ use \MediaWiki\Special\SpecialPageFactory;
|
|||
/**
|
||||
* Director responsible for building Main Menu
|
||||
*/
|
||||
final class Director {
|
||||
final class MainMenuDirector {
|
||||
|
||||
/**
|
||||
* @var IBuilder
|
||||
* @var IMainMenuBuilder
|
||||
*/
|
||||
private $builder;
|
||||
|
||||
|
@ -53,13 +53,13 @@ final class Director {
|
|||
/**
|
||||
* Director responsible for Main Menu building
|
||||
*
|
||||
* @param IBuilder $builder
|
||||
* @param IMainMenuBuilder $builder
|
||||
* @param MessageLocalizer $messageLocalizer Used for translating texts in menu toggle
|
||||
* @param SpecialPageFactory $specialPageFactory Used to check for MobileMenu special page
|
||||
* existence
|
||||
*/
|
||||
public function __construct(
|
||||
IBuilder $builder,
|
||||
IMainMenuBuilder $builder,
|
||||
MessageLocalizer $messageLocalizer,
|
||||
SpecialPageFactory $specialPageFactory
|
||||
) {
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Minerva\Menu\Main\Director as MainMenuDirector;
|
||||
use MediaWiki\Minerva\Menu\Main\MainMenuDirector;
|
||||
use MediaWiki\Minerva\Permissions\IMinervaPagePermissions;
|
||||
use MediaWiki\Minerva\SkinOptions;
|
||||
use MediaWiki\Minerva\SkinUserPageHelper;
|
||||
|
|
Loading…
Reference in a new issue