Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891299
PhabricatorOwnersAuditRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorOwnersAuditRule.php
View Options
<?php
final
class
PhabricatorOwnersAuditRule
extends
Phobject
{
const
AUDITING_NONE
=
'none'
;
const
AUDITING_NO_OWNER
=
'audit'
;
const
AUDITING_UNREVIEWED
=
'unreviewed'
;
const
AUDITING_NO_OWNER_AND_UNREVIEWED
=
'uninvolved-unreviewed'
;
const
AUDITING_ALL
=
'all'
;
private
$key
;
private
$spec
;
public
static
function
newFromState
(
$key
)
{
$specs
=
self
::
newSpecifications
(
)
;
$spec
=
idx
(
$specs
,
$key
,
array
(
)
)
;
$rule
=
new
self
(
)
;
$rule
->
key
=
$key
;
$rule
->
spec
=
$spec
;
return
$rule
;
}
public
function
getKey
(
)
{
return
$this
->
key
;
}
public
function
getDisplayName
(
)
{
return
idx
(
$this
->
spec
,
'name'
,
$this
->
key
)
;
}
public
function
getIconIcon
(
)
{
return
idx
(
$this
->
spec
,
'icon.icon'
)
;
}
public
static
function
newSelectControlMap
(
)
{
$specs
=
self
::
newSpecifications
(
)
;
return
ipull
(
$specs
,
'name'
)
;
}
public
static
function
getStorageValueFromAPIValue
(
$value
)
{
$specs
=
self
::
newSpecifications
(
)
;
$map
=
array
(
)
;
foreach
(
$specs
as
$key
=>
$spec
)
{
$deprecated
=
idx
(
$spec
,
'deprecated'
,
array
(
)
)
;
if
(
isset
(
$deprecated
[
$value
]
)
)
{
return
$key
;
}
}
return
$value
;
}
public
static
function
getModernValueMap
(
)
{
$specs
=
self
::
newSpecifications
(
)
;
$map
=
array
(
)
;
foreach
(
$specs
as
$key
=>
$spec
)
{
$map
[
$key
]
=
pht
(
'"%s"'
,
$key
)
;
}
return
$map
;
}
public
static
function
getDeprecatedValueMap
(
)
{
$specs
=
self
::
newSpecifications
(
)
;
$map
=
array
(
)
;
foreach
(
$specs
as
$key
=>
$spec
)
{
$deprecated_map
=
idx
(
$spec
,
'deprecated'
,
array
(
)
)
;
foreach
(
$deprecated_map
as
$deprecated_key
=>
$label
)
{
$map
[
$deprecated_key
]
=
$label
;
}
}
return
$map
;
}
private
static
function
newSpecifications
(
)
{
return
array
(
self
::
AUDITING_NONE
=>
array
(
'name'
=>
pht
(
'No Auditing'
)
,
'icon.icon'
=>
'fa-ban'
,
'deprecated'
=>
array
(
''
=>
pht
(
'"" (empty string)'
)
,
'0'
=>
'"0"'
,
)
,
)
,
self
::
AUDITING_UNREVIEWED
=>
array
(
'name'
=>
pht
(
'Audit Unreviewed Commits'
)
,
'icon.icon'
=>
'fa-check'
,
)
,
self
::
AUDITING_NO_OWNER
=>
array
(
'name'
=>
pht
(
'Audit Commits With No Owner Involvement'
)
,
'icon.icon'
=>
'fa-check'
,
'deprecated'
=>
array
(
'1'
=>
'"1"'
,
)
,
)
,
self
::
AUDITING_NO_OWNER_AND_UNREVIEWED
=>
array
(
'name'
=>
pht
(
'Audit Unreviewed Commits and Commits With No Owner Involvement'
)
,
'icon.icon'
=>
'fa-check'
,
)
,
self
::
AUDITING_ALL
=>
array
(
'name'
=>
pht
(
'Audit All Commits'
)
,
'icon.icon'
=>
'fa-check'
,
)
,
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 14:59 (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125742
Default Alt Text
PhabricatorOwnersAuditRule.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment