Debian Codegraph @

extensions/VisualEditor/includes/VisualEditorApiVisualEditorEditPostSaveHook.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\VisualEditor;
4
5 use MediaWiki\Page\ProperPageIdentity;
6 use MediaWiki\User\UserIdentity;
7
8 /**
9 * VisualEditorApiVisualEditorEditPostSaveHook
10 *
11 * @file
12 * @ingroup Extensions
13 * @copyright 2011-2021 VisualEditor Team and others; see AUTHORS.txt
14 * @license MIT
15 */
16
17 interface VisualEditorApiVisualEditorEditPostSaveHook {
18
19 /**
20 * This hook is executed in the ApiVisualEditorEdit after a action=save attempt.
21 *
22 * ApiVisualEditorEdit will wait for implementations of this hook to complete before returning a response, so
23 * if the implementation needs to do something time-consuming that does not need to be sent back with the response,
24 * consider using a DeferredUpdate or Job.
25 *
26 * @param ProperPageIdentity $page The page identity of the title used in the save attempt.
27 * @param UserIdentity $user User associated with the save attempt.
28 * @param string $wikitext The wikitext used in the save attempt.
29 * @param array $params The params passed by the client in the API request. See
30 * ApiVisualEditorEdit::getAllowedParams()
31 * @param array $pluginData Associative array containing additional data specified by plugins, where the keys of
32 * the array are plugin names and the value are arbitrary data.
33 * @param array $saveResult The result from ApiVisualEditorEdit::saveWikitext()
34 * @param array &$apiResponse The modifiable API response that VisualEditor will return to the client.
35 * @return void
36 */
37 public function onVisualEditorApiVisualEditorEditPostSave(
38 ProperPageIdentity $page,
39 UserIdentity $user,
40 string $wikitext,
41 array $params,
42 array $pluginData,
43 array $saveResult,
44 array &$apiResponse
45 ): void;
46
47 }