Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Deferred; |
4 | |
5 | /** |
6 | * Interface that deferrable updates can implement to signal that updates can be combined. |
7 | * |
8 | * DeferredUpdates uses this to merge all pending updates of PHP class into a single update |
9 | * by calling merge(). Note that upon merge(), the combined update goes to the back of the FIFO |
10 | * queue so that such updates occur after related non-mergeable deferred updates. For example, |
11 | * suppose updates that purge URL objects all use the same MergeableUpdate class, updates that |
12 | * delete URL objects use a different class, and the calling pattern is: |
13 | * - a) DeferredUpdates::addUpdate( $purgeCdnUrlsA ); |
14 | * - b) DeferredUpdates::addUpdate( $deleteContentUrlsB ); |
15 | * - c) DeferredUpdates::addUpdate( $purgeCdnUrlsB ) |
16 | * |
17 | * In this case, purges for urls A and B will all happen after the $deleteContentUrlsB update. |
18 | * |
19 | * @stable to implement |
20 | * |
21 | * @since 1.27 |
22 | */ |
23 | interface MergeableUpdate extends DeferrableUpdate { |
24 | /** |
25 | * Merge this enqueued update with a new MergeableUpdate of the same qualified class name |
26 | * |
27 | * @param MergeableUpdate $update The new update (having the same class) |
28 | */ |
29 | public function merge( MergeableUpdate $update ); |
30 | } |
31 | |
32 | /** @deprecated class alias since 1.42 */ |
33 | class_alias( MergeableUpdate::class, 'MergeableUpdate' ); |