| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Storage\Hook; |
| 4 | |
| 5 | use MediaWiki\CommentStore\CommentStoreComment; |
| 6 | use MediaWiki\Content\Content; |
| 7 | use MediaWiki\User\User; |
| 8 | use StatusValue; |
| 9 | use WikiPage; |
| 10 | |
| 11 | /** |
| 12 | * This is a hook handler interface, see docs/Hooks.md. |
| 13 | * Use the hook name "PageContentSave" to register handlers implementing this interface. |
| 14 | * |
| 15 | * @deprecated since 1.35 Use MultiContentSave instead |
| 16 | * @ingroup Hooks |
| 17 | */ |
| 18 | interface PageContentSaveHook { |
| 19 | /** |
| 20 | * This hook is called before an article is saved. |
| 21 | * |
| 22 | * @since 1.35 |
| 23 | * |
| 24 | * @param WikiPage $wikiPage WikiPage being saved |
| 25 | * @param User $user User saving the article |
| 26 | * @param Content $content New article content |
| 27 | * @param CommentStoreComment &$summary Edit comment. Can be replaced with a new one. |
| 28 | * @param bool $isminor Whether the edit was marked as minor |
| 29 | * @param null $iswatch Previously a watch flag. Currently unused, always null. |
| 30 | * @param null $section Previously the section number being edited. Currently unused, always null. |
| 31 | * @param int $flags All EDIT_… flags (including EDIT_MINOR) as an integer number. |
| 32 | * See WikiPage::doUserEditContent documentation for flags' definition. |
| 33 | * @param StatusValue $status StatusValue object for the hook handlers resulting status. |
| 34 | * Either set $status->fatal() or return false to abort the save action. |
| 35 | * @return bool|void True or no return value to continue or false to abort |
| 36 | */ |
| 37 | public function onPageContentSave( $wikiPage, $user, $content, &$summary, |
| 38 | $isminor, $iswatch, $section, $flags, $status |
| 39 | ); |
| 40 | } |