Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | |
| 7 | namespace MediaWiki\Storage; |
| 8 | |
| 9 | /** |
| 10 | * Constants for representing well known causes for page updates. |
| 11 | * Extensions may use different causes representing their specific reason |
| 12 | * for updating pages. |
| 13 | * |
| 14 | * This is modeled as an interface to provide easy access to these constants to |
| 15 | * both the emitter and the subscriber of events, without creating unnecessary |
| 16 | * dependencies: Since PageUpdater and PageLatestRevisionChangedEvent both implement this |
| 17 | * interface, callers of PageUpdater do not need to know about PageLatestRevisionChangedEvent, |
| 18 | * and subscribers of PageLatestRevisionChangedEvent do not need to know about PageUpdater. |
| 19 | * |
| 20 | * @unstable until 1.45 |
| 21 | */ |
| 22 | interface PageUpdateCauses { |
| 23 | |
| 24 | /** @var string The update was a deletion. */ |
| 25 | public const CAUSE_DELETE = 'delete'; |
| 26 | |
| 27 | /** @var string The update was an undeletion. */ |
| 28 | public const CAUSE_UNDELETE = 'undelete'; |
| 29 | |
| 30 | /** @var string The update was an import. */ |
| 31 | public const CAUSE_IMPORT = 'import'; |
| 32 | |
| 33 | /** @var string The update was due to a page move. */ |
| 34 | public const CAUSE_MOVE = 'move'; |
| 35 | |
| 36 | /** @var string The update was an edit. */ |
| 37 | public const CAUSE_EDIT = 'edit'; |
| 38 | |
| 39 | /** |
| 40 | * @var string The update was a change to the page |
| 41 | * protection (aka restrictions). |
| 42 | */ |
| 43 | public const CAUSE_PROTECTION_CHANGE = 'protection_change'; |
| 44 | |
| 45 | /** @var string The update was caused by a file upload */ |
| 46 | public const CAUSE_UPLOAD = 'upload'; |
| 47 | |
| 48 | /** @var string The update was caused by the rollback action */ |
| 49 | public const CAUSE_ROLLBACK = 'rollback'; |
| 50 | |
| 51 | /** @var string The update was caused by the undo action */ |
| 52 | public const CAUSE_UNDO = 'undo'; |
| 53 | |
| 54 | } |