Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118222261
HeraldRepetitionPolicyConfig.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
Wed, Jun 18, 13:25
Size
666 B
Mime Type
text/x-php
Expires
Fri, Jun 20, 13:25 (2 d)
Engine
blob
Format
Raw Data
Handle
26778894
Attached To
rPH Phabricator
HeraldRepetitionPolicyConfig.php
View Options
<?php
final
class
HeraldRepetitionPolicyConfig
{
const
FIRST
=
'first'
;
// only execute the first time (no repeating)
const
EVERY
=
'every'
;
// repeat every time
private
static
$policyIntMap
=
array
(
self
::
FIRST
=>
0
,
self
::
EVERY
=>
1
,
);
public
static
function
getMap
()
{
return
array
(
self
::
EVERY
=>
pht
(
'every time'
),
self
::
FIRST
=>
pht
(
'only the first time'
),
);
}
public
static
function
toInt
(
$str
)
{
return
idx
(
self
::
$policyIntMap
,
$str
,
self
::
$policyIntMap
[
self
::
EVERY
]);
}
public
static
function
toString
(
$int
)
{
return
idx
(
array_flip
(
self
::
$policyIntMap
),
$int
,
self
::
EVERY
);
}
}
Event Timeline
Log In to Comment