mediawiki-extensions-Scribunto/includes/Hooks/HookRunner.php
Umherirrender 2ee5768ef5 Create HookRunner class and the hook handler interfaces
Bug: T271026
Change-Id: If525e0f950b3a098162b19373edb3b443f559bf2
2023-06-19 21:39:33 +00:00

41 lines
892 B
PHP

<?php
namespace MediaWiki\Extension\Scribunto\Hooks;
use MediaWiki\HookContainer\HookContainer;
/**
* This is a hook runner class, see docs/Hooks.md in core.
* @internal
*/
class HookRunner implements
ScribuntoExternalLibrariesHook,
ScribuntoExternalLibraryPathsHook
{
private HookContainer $hookContainer;
public function __construct( HookContainer $hookContainer ) {
$this->hookContainer = $hookContainer;
}
/**
* @inheritDoc
*/
public function onScribuntoExternalLibraries( string $engine, array &$extraLibraries ) {
return $this->hookContainer->run(
'ScribuntoExternalLibraries',
[ $engine, &$extraLibraries ]
);
}
/**
* @inheritDoc
*/
public function onScribuntoExternalLibraryPaths( string $engine, array &$extraLibraryPaths ) {
return $this->hookContainer->run(
'ScribuntoExternalLibraryPaths',
[ $engine, &$extraLibraryPaths ]
);
}
}