Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102361260
PhabricatorXHPASTViewTreeController.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
Wed, Feb 19, 22:01
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Feb 21, 22:01 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24338554
Attached To
rPH Phabricator
PhabricatorXHPASTViewTreeController.php
View Options
<?php
final
class
PhabricatorXHPASTViewTreeController
extends
PhabricatorXHPASTViewPanelController
{
public
function
processRequest
()
{
$storage
=
$this
->
getStorageTree
();
$input
=
$storage
->
getInput
();
$stdout
=
$storage
->
getStdout
();
$tree
=
XHPASTTree
::
newFromDataAndResolvedExecFuture
(
$input
,
array
(
0
,
$stdout
,
''
));
$tree
=
phutil_tag
(
'ul'
,
array
(),
$this
->
buildTree
(
$tree
->
getRootNode
()));
return
$this
->
buildXHPASTViewPanelResponse
(
$tree
);
}
protected
function
buildTree
(
$root
)
{
try
{
$name
=
$root
->
getTypeName
();
$title
=
$root
->
getDescription
();
}
catch
(
Exception
$ex
)
{
$name
=
'???'
;
$title
=
'???'
;
}
$tree
=
array
();
$tree
[]
=
phutil_tag
(
'li'
,
array
(),
phutil_tag
(
'span'
,
array
(
'title'
=>
$title
,
),
$name
));
foreach
(
$root
->
getChildren
()
as
$child
)
{
$tree
[]
=
phutil_tag
(
'ul'
,
array
(),
$this
->
buildTree
(
$child
));
}
return
phutil_implode_html
(
"
\n
"
,
$tree
);
}
}
Event Timeline
Log In to Comment