Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php
12256 views
1
<?php
2
3
final class HeraldDifferentialDiffAdapter extends HeraldDifferentialAdapter {
4
5
public function getAdapterApplicationClass() {
6
return 'PhabricatorDifferentialApplication';
7
}
8
9
protected function initializeNewAdapter() {
10
$this->setDiff(new DifferentialDiff());
11
}
12
13
public function isSingleEventAdapter() {
14
return true;
15
}
16
17
protected function loadChangesets() {
18
return $this->loadChangesetsWithHunks();
19
}
20
21
protected function loadChangesetsWithHunks() {
22
return $this->getDiff()->getChangesets();
23
}
24
25
public function getObject() {
26
return $this->getDiff();
27
}
28
29
public function getAdapterContentType() {
30
return 'differential.diff';
31
}
32
33
public function getAdapterContentName() {
34
return pht('Differential Diffs');
35
}
36
37
public function getAdapterContentDescription() {
38
return pht(
39
"React to new diffs being uploaded, before writes occur.\n".
40
"These rules can reject diffs before they are written to permanent ".
41
"storage, to prevent users from accidentally uploading private keys or ".
42
"other sensitive information.");
43
}
44
45
public function supportsRuleType($rule_type) {
46
switch ($rule_type) {
47
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
48
return true;
49
case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
50
case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
51
default:
52
return false;
53
}
54
}
55
56
public function getHeraldName() {
57
return pht('New Diff');
58
}
59
60
public function supportsWebhooks() {
61
return false;
62
}
63
64
}
65
66