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 | namespace MediaWiki\Extension\CommunityConfiguration\Schema; |
4 | |
5 | use stdClass; |
6 | |
7 | /** |
8 | * Class capable of converting data to conform to a particular schema version (using either data |
9 | * confirming to the immediately preceding schema version, or to the immediately succeeding |
10 | * schema version). |
11 | * |
12 | * This can be used to write schema migration, and to reflect schema changes in the |
13 | * CommunityConfiguration-managed data. |
14 | * |
15 | * In the future, CommunityConfiguration should be capable of (partially) autogenerating migration |
16 | * classes (implementing this interface), but this is not yet the case. |
17 | */ |
18 | interface ISchemaConverter { |
19 | |
20 | /** |
21 | * Upgrade data using older data |
22 | * |
23 | * @param stdClass $data Data conforming to the immediately preceding schema version |
24 | * @return stdClass Result of conversion |
25 | */ |
26 | public function upgradeFromOlder( stdClass $data ): stdClass; |
27 | |
28 | /** |
29 | * Downgrade data using newer data |
30 | * |
31 | * @param stdClass $data Data conforming to the immediately succeeding schema version |
32 | * @return stdClass Result of conversion |
33 | */ |
34 | public function downgradeFromNewer( stdClass $data ): stdClass; |
35 | } |