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