-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathFingerprintPatcher.php
More file actions
61 lines (51 loc) · 1.23 KB
/
FingerprintPatcher.php
File metadata and controls
61 lines (51 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace Wikibase\DataModel\Services\Diff\Internal;
use Diff\Patcher\PatcherException;
use Wikibase\DataModel\Services\Diff\EntityDiff;
use Wikibase\DataModel\Services\Diff\TermListPatcher;
use Wikibase\DataModel\Term\Fingerprint;
/**
* Package private.
*
* @since 1.0
*
* @license GPL-2.0+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Thiemo Mättig
*/
class FingerprintPatcher {
/**
* @var TermListPatcher
*/
private $termListPatcher;
/**
* @var AliasGroupListPatcher
*/
private $aliasGroupListPatcher;
public function __construct() {
$this->termListPatcher = new TermListPatcher();
$this->aliasGroupListPatcher = new AliasGroupListPatcher();
}
/**
* @since 1.0
*
* @param Fingerprint $fingerprint
* @param EntityDiff $patch
*
* @throws PatcherException
*/
public function patchFingerprint( Fingerprint $fingerprint, EntityDiff $patch ) {
$this->termListPatcher->patchTermList(
$fingerprint->getLabels(),
$patch->getLabelsDiff()
);
$this->termListPatcher->patchTermList(
$fingerprint->getDescriptions(),
$patch->getDescriptionsDiff()
);
$this->aliasGroupListPatcher->patchAliasGroupList(
$fingerprint->getAliasGroups(),
$patch->getAliasesDiff()
);
}
}