| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\Status\Status; |
| 6 | use MediaWiki\User\User; |
| 7 | use WikiPage; |
| 8 | |
| 9 | /** |
| 10 | * This is a hook handler interface, see docs/Hooks.md. |
| 11 | * Use the hook name "WatchArticle" to register handlers implementing this interface. |
| 12 | * |
| 13 | * @stable to implement |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 16 | interface WatchArticleHook { |
| 17 | /** |
| 18 | * This hook is called before a watch is added to an article. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param User $user User that will watch |
| 23 | * @param WikiPage $page WikiPage object to be watched |
| 24 | * @param Status &$status Status object to be returned if the hook returns false |
| 25 | * @param string|null $expiry Optional expiry timestamp in any format acceptable to wfTimestamp() |
| 26 | * @return bool|void True or no return value to continue or false to abort and |
| 27 | * return Status object |
| 28 | */ |
| 29 | public function onWatchArticle( $user, $page, &$status, $expiry ); |
| 30 | } |