2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Api\Hook;
|
|
|
|
|
|
2020-03-16 23:31:05 +00:00
|
|
|
use ApiOptions;
|
|
|
|
|
use User;
|
|
|
|
|
|
2020-03-03 22:50:34 +00:00
|
|
|
/**
|
2020-07-13 09:05:49 +00:00
|
|
|
* @stable to implement
|
2020-03-03 22:50:34 +00:00
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface ApiOptionsHook {
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* This hook is called by action=options before applying changes to user
|
2020-03-03 22:50:34 +00:00
|
|
|
* preferences.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param ApiOptions $apiModule Calling ApiOptions object
|
|
|
|
|
* @param User $user User object whose preferences are being changed
|
|
|
|
|
* @param array $changes Associative array of preference name => value
|
|
|
|
|
* @param string[] $resetKinds Array of strings specifying which options kinds to reset
|
|
|
|
|
* See User::resetOptions() and User::getOptionKinds() for possible values.
|
2020-03-03 22:50:34 +00:00
|
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
|
|
|
*/
|
|
|
|
|
public function onApiOptions( $apiModule, $user, $changes, $resetKinds );
|
|
|
|
|
}
|