mediawiki-extensions-CodeEd.../includes/Hooks/HookRunner.php
Umherirrender 4d6a470aae Create HookRunner class and the hook handler interface
Bug: T271013
Change-Id: Ie8e152530599d11da12cb9272a3b757da1cca1ab
2023-06-04 21:23:14 +02:00

31 lines
669 B
PHP

<?php
namespace MediaWiki\Extension\CodeEditor\Hooks;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\Title\Title;
/**
* This is a hook runner class, see docs/Hooks.md in core.
* @internal
*/
class HookRunner implements
CodeEditorGetPageLanguageHook
{
private HookContainer $hookContainer;
public function __construct( HookContainer $hookContainer ) {
$this->hookContainer = $hookContainer;
}
/**
* @inheritDoc
*/
public function onCodeEditorGetPageLanguage( Title $title, ?string &$lang, string $model, string $format ) {
return $this->hookContainer->run(
'CodeEditorGetPageLanguage',
[ $title, &$lang, $model, $format ]
);
}
}