Skip to content

Commit

Permalink
Remove unused ExtensionRegistry
Browse files Browse the repository at this point in the history
Became unused in change 48337b6aae (commit 7ec5789).

Change-Id: I53a2e8bccaf6588cdddd9bb36a3478452bf66108
  • Loading branch information
lucaswerkmeister committed Jul 20, 2023
1 parent 54f28ed commit 3e8dd76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
8 changes: 0 additions & 8 deletions client/includes/Hooks/ExtensionLoadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Wikibase\Client\Hooks;

use ApiMain;
use ExtensionRegistry;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\MediaWikiServices;
use Parser;
Expand All @@ -24,27 +23,20 @@
*/
class ExtensionLoadHandler {

/** @var ExtensionRegistry */
private $extensionRegistry;

/** @var HookContainer */
private $hookContainer;

/**
* @param ExtensionRegistry $extensionRegistry
* @param HookContainer $hookContainer
*/
public function __construct(
ExtensionRegistry $extensionRegistry,
HookContainer $hookContainer
) {
$this->extensionRegistry = $extensionRegistry;
$this->hookContainer = $hookContainer;
}

public static function factory(): self {
return new self(
ExtensionRegistry::getInstance(),
MediaWikiServices::getInstance()->getHookContainer()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Wikibase\Client\Tests\Unit\Hooks;

use ExtensionRegistry;
use MediaWiki\HookContainer\HookContainer;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -37,12 +36,10 @@ function ( $name, $handler ) use ( &$hooks ) {
}

public function testGetHooks() {
$extensionRegistry = $this->createMock( ExtensionRegistry::class );

$actualHooks = [];
$container = $this->getFauxHookContainer( $actualHooks );

$handler = new ExtensionLoadHandler( $extensionRegistry, $container );
$handler = new ExtensionLoadHandler( $container );
$handler->registerHooks();

$expectedHooks = [
Expand All @@ -54,7 +51,7 @@ public function testGetHooks() {
}

public function testGetApiFormatReferenceSpec_settingTrue() {
$handler = new ExtensionLoadHandler( $this->createMock( ExtensionRegistry::class ), $this->createMock( HookContainer::class ) );
$handler = new ExtensionLoadHandler( $this->createMock( HookContainer::class ) );

$spec = $handler->getApiFormatReferenceSpec( [ 'dataBridgeEnabled' => true ] );

Expand All @@ -64,7 +61,7 @@ public function testGetApiFormatReferenceSpec_settingTrue() {

/** @dataProvider provideNotTrueDataBridgeEnabledSettings */
public function testGetApiFormatReferenceSpec_settingNotTrue( array $settings ) {
$handler = new ExtensionLoadHandler( $this->createMock( ExtensionRegistry::class ), $this->createMock( HookContainer::class ) );
$handler = new ExtensionLoadHandler( $this->createMock( HookContainer::class ) );

$spec = $handler->getApiFormatReferenceSpec( $settings );

Expand Down

0 comments on commit 3e8dd76

Please sign in to comment.