aboutsummaryrefslogtreecommitdiffstats
path: root/includes/preferences/Hook/PreferencesFormPreSaveHook.php
blob: 17b854fe93e7894f6fe09219ee05977b57d490df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace MediaWiki\Preferences\Hook;

use HTMLForm;
use User;

/**
 * This is a hook handler interface, see docs/Hooks.md.
 * Use the hook name "PreferencesFormPreSave" to register handlers implementing this interface.
 *
 * @stable to implement
 * @ingroup Hooks
 */
interface PreferencesFormPreSaveHook {
	/**
	 * Use this hook to override preferences being saved.
	 *
	 * @since 1.35
	 *
	 * @param array $formData Array of user submitted data
	 * @param HTMLForm $form HTMLForm object, also a ContextSource
	 * @param User $user User with preferences to be saved
	 * @param bool &$result Boolean indicating success
	 * @param array $oldUserOptions Array with user's old options (before save)
	 * @return bool|void True or no return value to continue or false to abort
	 */
	public function onPreferencesFormPreSave( $formData, $form, $user, &$result,
		$oldUserOptions
	);
}