Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88680571
ConduitUserParameterType.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
Sun, Oct 20, 03:33
Size
1003 B
Mime Type
text/x-php
Expires
Tue, Oct 22, 03:33 (2 d)
Engine
blob
Format
Raw Data
Handle
21788268
Attached To
rPH Phabricator
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'
,
);
}
}
Event Timeline
Log In to Comment