Skip to content

Commit

Permalink
Merge SkinVector and VectorTemplate (step 2/2)
Browse files Browse the repository at this point in the history
Rename SkinTemplateVector to restore SkinVector

Bug: T251212
Change-Id: I7e06a4cc226f3434c0f655212a464b8b98bcc7f4
  • Loading branch information
jdlrobson committed Jul 30, 2020
1 parent ee6974a commit 2c74f08
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use RequestContext;
use Skin;
use SkinTemplate;
use SkinTemplateVector;
use SkinVector;
use User;

/**
Expand All @@ -29,7 +29,7 @@ class Hooks {
* @param SkinTemplate $sk
*/
public static function onBeforePageDisplay( OutputPage $out, $sk ) {
if ( !$sk instanceof SkinTemplateVector ) {
if ( !$sk instanceof SkinVector ) {
return;
}

Expand Down Expand Up @@ -236,7 +236,7 @@ public static function onOutputPageBodyAttributes( OutputPage $out, Skin $sk, &$
* @param OutputPage $out OutputPage instance calling the hook
*/
public static function onMakeGlobalVariablesScript( &$vars, OutputPage $out ) {
if ( $out->getSkin() instanceof SkinTemplateVector ) {
if ( $out->getSkin() instanceof SkinVector ) {
$skinVersionLookup = new SkinVersionLookup(
$out->getRequest(),
$out->getUser(),
Expand Down
3 changes: 2 additions & 1 deletion includes/SkinTemplateVector.php → includes/SkinVector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
/**
* Skin subclass for Vector
* @ingroup Skins
* Skins extending SkinVector are not supported
*/
class SkinTemplateVector extends SkinMustache {
class SkinVector extends SkinMustache {

/** @var array of alternate message keys for menu labels */
private const MENU_LABEL_KEYS = [
Expand Down
6 changes: 3 additions & 3 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"ValidSkinNames": {
"vector": {
"class": "SkinTemplateVector",
"@args": "See SkinTemplateVector::__construct for more detail.",
"class": "SkinVector",
"@args": "See SkinVector::__construct for more detail.",
"args": [
{
"name": "vector",
Expand All @@ -39,7 +39,7 @@
]
},
"AutoloadClasses": {
"SkinTemplateVector": "includes/SkinTemplateVector.php"
"SkinVector": "includes/SkinVector.php"
},
"AutoloadNamespaces": {
"Vector\\": "includes/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use MediaWikiIntegrationTestCase;
use RequestContext;
use SkinTemplateVector;
use SkinVector;
use Title;
use Wikimedia\TestingAccessWrapper;

Expand All @@ -13,15 +13,15 @@
* @group Vector
* @group Skins
*
* @coversDefaultClass \SkinTemplateVector
* @coversDefaultClass \SkinVector
*/
class SkinTemplateVectorTest extends MediaWikiIntegrationTestCase {
class SkinVectorTest extends MediaWikiIntegrationTestCase {

/**
* @return \VectorTemplate
*/
private function provideVectorTemplateObject() {
$template = new SkinTemplateVector();
$template = new SkinVector();
return $template;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public function testMakeListItemRespectsCollapsibleOption() {
* @covers ::getMenuProps
*/
public function testGetMenuProps() {
$title = Title::newFromText( 'SkinTemplateVector' );
$title = Title::newFromText( 'SkinVector' );
$context = RequestContext::getMain();
$context->setTitle( $title );
$context->setLanguage( 'fr' );
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/integration/VectorHooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function testOnSkinTemplateNavigation() {
$this->setMwGlobals( [
'wgVectorUseIconWatch' => true
] );
$skin = new SkinTemplateVector( [ 'name' => 'vector' ] );
$skin = new SkinVector( [ 'name' => 'vector' ] );
$contentNavWatch = [
'actions' => [
'watch' => [ 'class' => 'watch' ],
Expand Down

0 comments on commit 2c74f08

Please sign in to comment.