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 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21namespace MediaWiki\Storage;
22
23/**
24 * Constants for representing well known causes for page updates.
25 * Extensions may use different causes representing their specific reason
26 * for updating pages.
27 *
28 * This is modeled as an interface to provide easy access to these constants to
29 * both the emitter and the subscriber of events, without creating unnecessary
30 * dependencies: Since PageUpdater and PageRevisionUpdatedEvent both implement this
31 * interface, callers of PageUpdater do not need to know about PageRevisionUpdatedEvent,
32 * and subscribers of PageRevisionUpdatedEvent do not need to know about PageUpdater.
33 *
34 * @unstable until 1.45
35 */
36interface PageUpdateCauses {
37
38    /** @var string The update was a deletion. */
39    public const CAUSE_DELETE = 'delete';
40
41    /** @var string The update was an undeletion. */
42    public const CAUSE_UNDELETE = 'undelete';
43
44    /** @var string The update was an import. */
45    public const CAUSE_IMPORT = 'import';
46
47    /** @var string The update was due to a page move. */
48    public const CAUSE_MOVE = 'move';
49
50    /** @var string The update was an edit. */
51    public const CAUSE_EDIT = 'edit';
52
53    /**
54     * @var string The update was a change to the page
55     *      protection (aka restrictions).
56     */
57    public const CAUSE_PROTECTION_CHANGE = 'protection_change';
58
59    /** @var string The update was caused by a file upload */
60    public const CAUSE_UPLOAD = 'upload';
61
62    /** @var string The update was caused by the rollback action */
63    public const CAUSE_ROLLBACK = 'rollback';
64
65    /** @var string The update was caused by the undo action */
66    public const CAUSE_UNDO = 'undo';
67
68}