mediawiki-extensions-Visual.../includes/ServiceWiring.php
Umherirrender 4e94b88f99 Remove the VisualEditorHookRunner service
The HookRunner class is a lightweight class and not designed to be a
service, the needed HookContainer should be injected instead and a hook
runner created when needed.
The overhead from the service wiring is the same as using new objects
when needed.
This follows practice from core and the documentation in
core/docs/Hooks.md in the section "Hook runner classes"

Change-Id: Ib42281dfae8a5a260005d82ed3bb7da12e1b645e
2024-01-31 20:02:36 +01:00

23 lines
499 B
PHP

<?php
/**
* ServiceWiring files for VisualEditor.
*
* @file
* @ingroup Extensions
* @copyright 2011-2021 VisualEditor Team and others; see AUTHORS.txt
* @license MIT
*/
namespace MediaWiki\Extension\VisualEditor;
use MediaWiki\MediaWikiServices;
return [
VisualEditorParsoidClientFactory::SERVICE_NAME => static function (
MediaWikiServices $services
): VisualEditorParsoidClientFactory {
return new VisualEditorParsoidClientFactory( $services->getPageRestHelperFactory() );
},
];