refactor(core): normalize PHP namespaces used in Citizen

Related: T303102
This commit is contained in:
alistair3149 2022-05-26 16:54:52 -04:00
parent 572e376b06
commit 58d85ff426
17 changed files with 40 additions and 38 deletions

View file

@ -20,7 +20,7 @@
* @file
*/
namespace Citizen\Api;
namespace MediaWiki\Skins\Citizen\Api;
use ApiBase;
use ApiFormatJson;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen;
namespace MediaWiki\Skins\Citizen;
use ConfigException;
use OutputPage;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Hooks;
namespace MediaWiki\Skins\Citizen\Hooks;
use Config;
use ResourceLoaderContext;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Hooks;
namespace MediaWiki\Skins\Citizen\Hooks;
use MediaWiki\Hook\BeforePageDisplayHook;
use MediaWiki\Skins\Hook\SkinPageReadyConfigHook;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use DOMDocument;
use DOMElement;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Exception;
use ExtensionRegistry;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
/**
* Footer partial of Skin Citizen

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use MediaWiki\MediaWikiServices;
use MWException;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use ResourceLoaderSkinModule;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Exception;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Action;
use Exception;

View file

@ -23,11 +23,11 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Citizen\GetConfigTrait;
use MediaWiki\Skins\Citizen\GetConfigTrait;
use MediaWiki\Skins\Citizen\SkinCitizen;
use OutputPage;
use SkinCitizen;
use Title;
/**

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Title;
use User;

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
/**
* Theme switcher partial of Skin Citizen

View file

@ -23,7 +23,7 @@
declare( strict_types=1 );
namespace Citizen\Partials;
namespace MediaWiki\Skins\Citizen\Partials;
use Html;
use MediaWiki\MediaWikiServices;

View file

@ -21,17 +21,23 @@
* @ingroup Skins
*/
use Citizen\GetConfigTrait;
use Citizen\Partials\BodyContent;
use Citizen\Partials\Drawer;
use Citizen\Partials\Footer;
use Citizen\Partials\Header;
use Citizen\Partials\Logos;
use Citizen\Partials\Metadata;
use Citizen\Partials\PageTools;
use Citizen\Partials\Tagline;
use Citizen\Partials\Theme;
use Citizen\Partials\Title;
namespace MediaWiki\Skins\Citizen;
use Linker;
use MediaWiki\Skins\Citizen\GetConfigTrait;
use MediaWiki\Skins\Citizen\Partials\BodyContent;
use MediaWiki\Skins\Citizen\Partials\Drawer;
use MediaWiki\Skins\Citizen\Partials\Footer;
use MediaWiki\Skins\Citizen\Partials\Header;
use MediaWiki\Skins\Citizen\Partials\Logos;
use MediaWiki\Skins\Citizen\Partials\Metadata;
use MediaWiki\Skins\Citizen\Partials\PageTools;
use MediaWiki\Skins\Citizen\Partials\Tagline;
use MediaWiki\Skins\Citizen\Partials\Theme;
use MediaWiki\Skins\Citizen\Partials\Title;
use Sanitizer;
use SkinMustache;
use Xml;
/**
* Skin subclass for Citizen
@ -99,7 +105,7 @@ class SkinCitizen extends SkinMustache {
'msg-sitetitle' => $this->msg( 'sitetitle' )->text(),
'html-mainpage-attributes' => Xml::expandAttributes(
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) + [
'href' => Skin::makeMainPageUrl(),
'href' => parent::makeMainPageUrl(),
]
),
'data-logos' => $logos->getLogoData(),

View file

@ -16,8 +16,7 @@
},
"ValidSkinNames": {
"citizen": {
"class": "SkinCitizen",
"@args": "See SkinCitizen::__construct for more detail.",
"class": "MediaWiki\\Skins\\Citizen\\SkinCitizen",
"args": [
{
"name": "citizen",
@ -54,23 +53,20 @@
"i18n"
]
},
"AutoloadClasses": {
"SkinCitizen": "includes/SkinCitizen.php"
},
"AutoloadNamespaces": {
"Citizen\\": "includes/"
"MediaWiki\\Skins\\Citizen\\": "includes/"
},
"ConfigRegistry": {
"Citizen": "GlobalVarConfig::newInstance"
"citizen": "GlobalVarConfig::newInstance"
},
"APIModules": {
"webapp-manifest": {
"class": "Citizen\\Api\\ApiWebappManifest"
"class": "MediaWiki\\Skins\\Citizen\\Api\\ApiWebappManifest"
}
},
"HookHandlers": {
"SkinHooks": {
"class": "Citizen\\Hooks\\SkinHooks"
"class": "MediaWiki\\Skins\\Citizen\\Hooks\\SkinHooks"
}
},
"Hooks": {