Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/herald/HeraldPreCommitAdapter.php
<?php | <?php | ||||
abstract class HeraldPreCommitAdapter extends HeraldAdapter { | abstract class HeraldPreCommitAdapter extends HeraldAdapter { | ||||
private $log; | private $log; | ||||
private $hookEngine; | private $hookEngine; | ||||
abstract public function isPreCommitRefAdapter(); | |||||
public function setPushLog(PhabricatorRepositoryPushLog $log) { | public function setPushLog(PhabricatorRepositoryPushLog $log) { | ||||
$this->log = $log; | $this->log = $log; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setHookEngine(DiffusionCommitHookEngine $engine) { | public function setHookEngine(DiffusionCommitHookEngine $engine) { | ||||
$this->hookEngine = $engine; | $this->hookEngine = $engine; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | switch ($rule_type) { | ||||
array( | array( | ||||
self::ACTION_EMAIL, | self::ACTION_EMAIL, | ||||
self::ACTION_NOTHING, | self::ACTION_NOTHING, | ||||
), | ), | ||||
parent::getActions($rule_type)); | parent::getActions($rule_type)); | ||||
} | } | ||||
} | } | ||||
public function getPHID() { | |||||
return $this->getObject()->getPHID(); | |||||
} | |||||
public function applyHeraldEffects(array $effects) { | public function applyHeraldEffects(array $effects) { | ||||
assert_instances_of($effects, 'HeraldEffect'); | assert_instances_of($effects, 'HeraldEffect'); | ||||
$result = array(); | $result = array(); | ||||
foreach ($effects as $effect) { | foreach ($effects as $effect) { | ||||
$action = $effect->getAction(); | $action = $effect->getAction(); | ||||
switch ($action) { | switch ($action) { | ||||
case self::ACTION_BLOCK: | case self::ACTION_BLOCK: | ||||
Show All 15 Lines |