Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1116
HeraldCustomAction.php
Active
Public
Actions
Authored by
hach-que
on Apr 16 2014, 6:10 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F144260: HeraldCustomAction.php
Apr 16 2014, 6:10 AM
2014-04-16 06:10:59 (UTC+0)
Subscribers
None
<?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
;
}
}
}
Event Timeline
hach-que
edited the content of this paste.
(Show Details)
Apr 16 2014, 6:10 AM
2014-04-16 06:10:59 (UTC+0)
hach-que
changed the title of this paste from untitled to
HeraldCustomAction.php
.
hach-que
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment