Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/editor/PhabricatorAuditEditor.php
Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | final class PhabricatorAuditEditor | ||||
protected function shouldApplyHeraldRules( | protected function shouldApplyHeraldRules( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhabricatorAuditTransaction::TYPE_COMMIT: | case PhabricatorAuditTransaction::TYPE_COMMIT: | ||||
$repository = $object->getRepository(); | $repository = $object->getRepository(); | ||||
if (!$repository->shouldPublish()) { | if (!$repository->shouldPublishCommit($object)) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return parent::shouldApplyHeraldRules($object, $xactions); | return parent::shouldApplyHeraldRules($object, $xactions); | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | final class PhabricatorAuditEditor | ||||
private function shouldPublishRepositoryActivity( | private function shouldPublishRepositoryActivity( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
// not every code path loads the repository so tread carefully | // not every code path loads the repository so tread carefully | ||||
// TODO: They should, and then we should simplify this. | // TODO: They should, and then we should simplify this. | ||||
$repository = $object->getRepository($assert_attached = false); | $repository = $object->getRepository($assert_attached = false); | ||||
if ($repository != PhabricatorLiskDAO::ATTACHABLE) { | if ($repository != PhabricatorLiskDAO::ATTACHABLE) { | ||||
if (!$repository->shouldPublish()) { | if (!$repository->shouldPublishCommit($object)) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
return $this->isCommitMostlyImported($object); | return $this->isCommitMostlyImported($object); | ||||
} | } | ||||
protected function shouldSendMail( | protected function shouldSendMail( | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |