| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Page\Hook; |
| 4 | |
| 5 | use MediaWiki\Revision\RevisionRecord; |
| 6 | use MediaWiki\User\UserIdentity; |
| 7 | use WikiPage; |
| 8 | |
| 9 | /** |
| 10 | * This is a hook handler interface, see docs/Hooks.md. |
| 11 | * Use the hook name "RevisionFromEditComplete" to register handlers implementing this interface. |
| 12 | * |
| 13 | * @stable to implement |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 16 | interface RevisionFromEditCompleteHook { |
| 17 | /** |
| 18 | * This hook is called when a revision was inserted due to an edit, |
| 19 | * file upload, import or page move. |
| 20 | * |
| 21 | * @since 1.35 |
| 22 | * |
| 23 | * @param WikiPage $wikiPage WikiPage edited |
| 24 | * @param RevisionRecord $rev New revision |
| 25 | * @param int|false $originalRevId If the edit restores or repeats an earlier revision (such as a |
| 26 | * rollback or a null revision), the ID of that earlier revision. False otherwise. |
| 27 | * (Used to be called $baseID.) |
| 28 | * @param UserIdentity $user Editing user |
| 29 | * @param string[] &$tags Tags to apply to the edit and recent change. This is empty, and |
| 30 | * replacement is ignored, in the case of import or page move. |
| 31 | * @return bool|void True or no return value to continue or false to abort |
| 32 | */ |
| 33 | public function onRevisionFromEditComplete( $wikiPage, $rev, $originalRevId, |
| 34 | $user, &$tags |
| 35 | ); |
| 36 | } |