Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34607051
ConduitAPIRequest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
ConduitAPIRequest.php
View Options
<?php
final
class
ConduitAPIRequest
{
protected
$params
;
private
$user
;
public
function
__construct
(
array
$params
)
{
$this
->
params
=
$params
;
}
public
function
getValue
(
$key
,
$default
=
null
)
{
return
coalesce
(
idx
(
$this
->
params
,
$key
),
$default
);
}
public
function
getAllParameters
()
{
return
$this
->
params
;
}
public
function
setUser
(
PhabricatorUser
$user
)
{
$this
->
user
=
$user
;
return
$this
;
}
/**
* Retrieve the authentic identity of the user making the request. If a
* method requires authentication (the default) the user object will always
* be available. If a method does not require authentication (i.e., overrides
* shouldRequireAuthentication() to return false) the user object will NEVER
* be available.
*
* @return PhabricatorUser Authentic user, available ONLY if the method
* requires authentication.
*/
public
function
getUser
()
{
if
(!
$this
->
user
)
{
throw
new
Exception
(
'You can not access the user inside the implementation of a Conduit '
.
'method which does not require authentication (as per '
.
'shouldRequireAuthentication()).'
);
}
return
$this
->
user
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 18, 11:42 PM (8 h, 57 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1a/44/1346944c71be34d9452032f73e32
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment