Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90383308
DifferentialBlockHeraldAction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 1, 04:03
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 3, 04:03 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22052791
Attached To
rPH Phabricator
DifferentialBlockHeraldAction.php
View Options
<?php
final
class
DifferentialBlockHeraldAction
extends
HeraldAction
{
const
ACTIONCONST
=
'differential.block'
;
const
DO_BLOCK
=
'do.block'
;
public
function
getHeraldActionName
()
{
return
pht
(
'Block diff with message'
);
}
public
function
getActionGroupKey
()
{
return
HeraldApplicationActionGroup
::
ACTIONGROUPKEY
;
}
public
function
supportsObject
(
$object
)
{
return
(
$object
instanceof
DifferentialDiff
);
}
public
function
supportsRuleType
(
$rule_type
)
{
return
(
$rule_type
!=
HeraldRuleTypeConfig
::
RULE_TYPE_PERSONAL
);
}
public
function
applyEffect
(
$object
,
HeraldEffect
$effect
)
{
// This rule intentionally has no direct effect: the caller handles it
// after executing Herald.
$this
->
logEffect
(
self
::
DO_BLOCK
);
}
public
function
getHeraldActionStandardType
()
{
return
self
::
STANDARD_TEXT
;
}
public
function
renderActionDescription
(
$value
)
{
return
pht
(
'Block diff with message: %s'
,
$value
);
}
protected
function
getActionEffectMap
()
{
return
array
(
self
::
DO_BLOCK
=>
array
(
'icon'
=>
'fa-stop'
,
'color'
=>
'red'
,
'name'
=>
pht
(
'Blocked Diff'
),
),
);
}
protected
function
renderActionEffectDescription
(
$type
,
$data
)
{
switch
(
$type
)
{
case
self
::
DO_BLOCK
:
return
pht
(
'Blocked diff.'
);
}
}
}
Event Timeline
Log In to Comment