Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547876
DiffusionFindSymbolsConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
DiffusionFindSymbolsConduitAPIMethod.php
View Options
<?php
final
class
DiffusionFindSymbolsConduitAPIMethod
extends
DiffusionConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'diffusion.findsymbols'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Retrieve Diffusion symbol information.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'name'
=>
'optional string'
,
'namePrefix'
=>
'optional string'
,
'context'
=>
'optional string'
,
'language'
=>
'optional string'
,
'type'
=>
'optional string'
,
'repositoryPHID'
=>
'optional string'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty list<dict>'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$name
=
$request
->
getValue
(
'name'
);
$name_prefix
=
$request
->
getValue
(
'namePrefix'
);
$context
=
$request
->
getValue
(
'context'
);
$language
=
$request
->
getValue
(
'language'
);
$type
=
$request
->
getValue
(
'type'
);
$repository
=
$request
->
getValue
(
'repositoryPHID'
);
$query
=
id
(
new
DiffusionSymbolQuery
())
->
setViewer
(
$request
->
getUser
());
if
(
$name
!==
null
)
{
$query
->
setName
(
$name
);
}
if
(
$name_prefix
!==
null
)
{
$query
->
setNamePrefix
(
$name_prefix
);
}
if
(
$context
!==
null
)
{
$query
->
setContext
(
$context
);
}
if
(
$language
!==
null
)
{
$query
->
setLanguage
(
$language
);
}
if
(
$type
!==
null
)
{
$query
->
setType
(
$type
);
}
if
(
$repository
!==
null
)
{
$query
->
withRepositoryPHIDs
(
array
(
$repository
));
}
$query
->
needPaths
(
true
);
$query
->
needRepositories
(
true
);
$results
=
$query
->
execute
();
$response
=
array
();
foreach
(
$results
as
$result
)
{
$uri
=
$result
->
getURI
();
if
(
$uri
)
{
$uri
=
PhabricatorEnv
::
getProductionURI
(
$uri
);
}
$response
[]
=
array
(
'name'
=>
$result
->
getSymbolName
(),
'context'
=>
$result
->
getSymbolContext
(),
'type'
=>
$result
->
getSymbolType
(),
'language'
=>
$result
->
getSymbolLanguage
(),
'path'
=>
$result
->
getPath
(),
'line'
=>
$result
->
getLineNumber
(),
'uri'
=>
$uri
,
'repositoryPHID'
=>
$result
->
getRepository
()->
getPHID
(),
);
}
return
$response
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:39 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120492
Default Alt Text
DiffusionFindSymbolsConduitAPIMethod.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment