Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2901438
ConduitUserParameterType.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
1003 B
Referenced Files
None
Subscribers
None
ConduitUserParameterType.php
View Options
<?php
final
class
ConduitUserParameterType
extends
ConduitParameterType
{
protected
function
getParameterValue
(
array
$request
,
$key
,
$strict
)
{
$value
=
parent
::
getParameterValue
(
$request
,
$key
,
$strict
)
;
if
(
$value
===
null
)
{
return
null
;
}
if
(
!
is_string
(
$value
)
)
{
$this
->
raiseValidationException
(
$request
,
$key
,
pht
(
'Expected PHID or null, got something else.'
)
)
;
}
$user_phids
=
id
(
new
PhabricatorUserPHIDResolver
(
)
)
->
setViewer
(
$this
->
getViewer
(
)
)
->
resolvePHIDs
(
array
(
$value
)
)
;
return
nonempty
(
head
(
$user_phids
)
,
null
)
;
}
protected
function
getParameterTypeName
(
)
{
return
'phid|string|null'
;
}
protected
function
getParameterFormatDescriptions
(
)
{
return
array
(
pht
(
'User PHID.'
)
,
pht
(
'Username.'
)
,
pht
(
'Literal null.'
)
,
)
;
}
protected
function
getParameterExamples
(
)
{
return
array
(
'"PHID-USER-1111"'
,
'"alincoln"'
,
'null'
,
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jan 20, 09:43 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120428
Default Alt Text
ConduitUserParameterType.php (1003 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment