diff --git a/extension.json b/extension.json index af7116eae4..db1ae0885a 100644 --- a/extension.json +++ b/extension.json @@ -179,7 +179,7 @@ "visualeditoredit": { "class": "MediaWiki\\Extension\\VisualEditor\\ApiVisualEditorEdit", "services": [ - "VisualEditorHookRunner", + "HookContainer", "StatsdDataFactory", "PageEditStash", "SkinFactory", diff --git a/includes/ApiVisualEditorEdit.php b/includes/ApiVisualEditorEdit.php index 376484f4a2..0a092e8d76 100644 --- a/includes/ApiVisualEditorEdit.php +++ b/includes/ApiVisualEditorEdit.php @@ -21,6 +21,7 @@ use ExtensionRegistry; use FlaggablePageView; use IBufferingStatsdDataFactory; use IDBAccessObject; +use MediaWiki\HookContainer\HookContainer; use MediaWiki\Logger\LoggerFactory; use MediaWiki\Page\WikiPageFactory; use MediaWiki\Request\DerivativeRequest; @@ -51,7 +52,7 @@ class ApiVisualEditorEdit extends ApiBase { public function __construct( ApiMain $main, string $name, - VisualEditorHookRunner $hookRunner, + HookContainer $hookContainer, IBufferingStatsdDataFactory $statsdDataFactory, PageEditStash $pageEditStash, SkinFactory $skinFactory, @@ -62,7 +63,7 @@ class ApiVisualEditorEdit extends ApiBase { parent::__construct( $main, $name ); $this->setLogger( LoggerFactory::getInstance( 'VisualEditor' ) ); $this->setStats( $statsdDataFactory ); - $this->hookRunner = $hookRunner; + $this->hookRunner = new VisualEditorHookRunner( $hookContainer ); $this->pageEditStash = $pageEditStash; $this->skinFactory = $skinFactory; $this->wikiPageFactory = $wikiPageFactory; diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 63e7f55f44..5f8b21c6e8 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -14,10 +14,6 @@ namespace MediaWiki\Extension\VisualEditor; use MediaWiki\MediaWikiServices; return [ - VisualEditorHookRunner::SERVICE_NAME => static function ( MediaWikiServices $services ): VisualEditorHookRunner { - return new VisualEditorHookRunner( $services->getHookContainer() ); - }, - VisualEditorParsoidClientFactory::SERVICE_NAME => static function ( MediaWikiServices $services ): VisualEditorParsoidClientFactory { diff --git a/includes/VisualEditorHookRunner.php b/includes/VisualEditorHookRunner.php index 462edd7b07..d19a674086 100644 --- a/includes/VisualEditorHookRunner.php +++ b/includes/VisualEditorHookRunner.php @@ -23,8 +23,6 @@ class VisualEditorHookRunner implements VisualEditorBeforeEditorHook { - public const SERVICE_NAME = 'VisualEditorHookRunner'; - /** @var HookContainer */ private $hookContainer;