mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-15 03:23:45 +00:00
4d6a470aae
Bug: T271013 Change-Id: Ie8e152530599d11da12cb9272a3b757da1cca1ab
31 lines
669 B
PHP
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 ]
|
|
);
|
|
}
|
|
}
|