Page MenuHomePhabricator

HeraldCustomAction.php

Authored By
hach-que
Apr 16 2014, 6:10 AM
Size
824 B
Referenced Files
None
Subscribers
None

HeraldCustomAction.php

<?php
abstract class HeraldCustomAction {
public abstract function appliesToAdapter(HeraldAdapter $adapter);
public abstract function getAvailableActions(HeraldAdapter $adapter);
public abstract function applyAction($object, $action);
}
final class RiskReviewHeraldCustomAction extends HeraldCustomAction {
public function appliesToAdapter(HeraldAdapter $adapter) {
return $adapter instanceof HeraldDifferentialRevisionAdapter;
}
public function getAvailableActions(HeraldAdapter $adapter) {
return array(
'add-risk' => array(
'name' => 'Add risk rating',
'type' => 'text'));
}
public function applyAction($object, $action) {
switch ($action) {
case 'add-risk':
// TODO: Do something with the DifferentialRevision $object.
break;
}
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/oh/uw/2fltnokfjvdpbxea
Default Alt Text
HeraldCustomAction.php (824 B)

Event Timeline