Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/editor/PhabricatorAuditEditor.php
<?php | <?php | ||||
final class PhabricatorAuditEditor | final class PhabricatorAuditEditor | ||||
extends PhabricatorApplicationTransactionEditor { | extends PhabricatorApplicationTransactionEditor { | ||||
const MAX_FILES_SHOWN_IN_EMAIL = 1000; | const MAX_FILES_SHOWN_IN_EMAIL = 1000; | ||||
private $auditReasonMap = array(); | private $auditReasonMap = array(); | ||||
private $affectedFiles; | private $affectedFiles; | ||||
private $rawPatch; | private $rawPatch; | ||||
private $auditorPHIDs = array(); | private $auditorPHIDs = array(); | ||||
private $didExpandInlineState; | private $didExpandInlineState = false; | ||||
public function addAuditReason($phid, $reason) { | public function addAuditReason($phid, $reason) { | ||||
if (!isset($this->auditReasonMap[$phid])) { | if (!isset($this->auditReasonMap[$phid])) { | ||||
$this->auditReasonMap[$phid] = array(); | $this->auditReasonMap[$phid] = array(); | ||||
} | } | ||||
$this->auditReasonMap[$phid][] = $reason; | $this->auditReasonMap[$phid][] = $reason; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 40 Lines | public function getTransactionTypes() { | ||||
// at a time later on. | // at a time later on. | ||||
$types[] = PhabricatorAuditActionConstants::ACTION; | $types[] = PhabricatorAuditActionConstants::ACTION; | ||||
$types[] = PhabricatorAuditActionConstants::INLINE; | $types[] = PhabricatorAuditActionConstants::INLINE; | ||||
$types[] = PhabricatorAuditActionConstants::ADD_AUDITORS; | $types[] = PhabricatorAuditActionConstants::ADD_AUDITORS; | ||||
return $types; | return $types; | ||||
} | } | ||||
protected function expandTransactions( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
foreach ($xactions as $xaction) { | |||||
switch ($xaction->getTransactionType()) { | |||||
case PhabricatorTransactions::TYPE_INLINESTATE: | |||||
$this->didExpandInlineState = true; | |||||
break; | |||||
} | |||||
} | |||||
return parent::expandTransactions($object, $xactions); | |||||
} | |||||
protected function transactionHasEffect( | protected function transactionHasEffect( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhabricatorAuditActionConstants::INLINE: | case PhabricatorAuditActionConstants::INLINE: | ||||
return $xaction->hasComment(); | return $xaction->hasComment(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 915 Lines • Show Last 20 Lines |