Path: blob/master/src/applications/differential/herald/HeraldDifferentialDiffAdapter.php
12256 views
<?php12final class HeraldDifferentialDiffAdapter extends HeraldDifferentialAdapter {34public function getAdapterApplicationClass() {5return 'PhabricatorDifferentialApplication';6}78protected function initializeNewAdapter() {9$this->setDiff(new DifferentialDiff());10}1112public function isSingleEventAdapter() {13return true;14}1516protected function loadChangesets() {17return $this->loadChangesetsWithHunks();18}1920protected function loadChangesetsWithHunks() {21return $this->getDiff()->getChangesets();22}2324public function getObject() {25return $this->getDiff();26}2728public function getAdapterContentType() {29return 'differential.diff';30}3132public function getAdapterContentName() {33return pht('Differential Diffs');34}3536public function getAdapterContentDescription() {37return pht(38"React to new diffs being uploaded, before writes occur.\n".39"These rules can reject diffs before they are written to permanent ".40"storage, to prevent users from accidentally uploading private keys or ".41"other sensitive information.");42}4344public function supportsRuleType($rule_type) {45switch ($rule_type) {46case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:47return true;48case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:49case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:50default:51return false;52}53}5455public function getHeraldName() {56return pht('New Diff');57}5859public function supportsWebhooks() {60return false;61}6263}646566