Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / parser / Hook / ParserFetchTemplateDataHook.php
blobb9e0f9da716efe75b97bf111dd51b5f714359895
1 <?php
3 namespace MediaWiki\Hook;
5 /**
6 * This is a hook handler interface, see docs/Hooks.md.
7 * Use the hook name "ParserFetchTemplateData" to register handlers
8 * implementing this interface.
10 * @unstable
11 * @ingroup Hooks
13 interface ParserFetchTemplateDataHook {
14 /**
15 * This hook allows Parsoid to fetch additional serialization information
16 * about a Template, including the type of its arguments, whether they
17 * should be serialized as inline or block style wikitext, etc.
18 * See [[Extension:TemplateData]] for more information.
20 * @param string[] $titles An array of template names
21 * @param array<string,object> &$tplData The hook will create an
22 * associative array, mapping each given
23 * template name to an object representing the TemplateData for that
24 * template, or special objects if the title doesn't exist, is missing
25 * TemplateData, or has malformed TemplateData.
26 * @return bool Typically returns true, to allow all registered hooks a
27 * chance to fill in template data.
29 * @unstable temporary hook; will be cleaned up before it is made stable
30 * @since 1.39
32 public function onParserFetchTemplateData(
33 array $titles,
34 array &$tplData
35 ): bool;