Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95721634
PhutilConsoleBlock.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, Dec 18, 16:18
Size
878 B
Mime Type
text/x-php
Expires
Fri, Dec 20, 16:18 (2 d)
Engine
blob
Format
Raw Data
Handle
23046198
Attached To
rPHU libphutil
PhutilConsoleBlock.php
View Options
<?php
final
class
PhutilConsoleBlock
extends
PhutilConsoleView
{
private
$items
=
array
();
public
function
addParagraph
(
$item
)
{
$this
->
items
[]
=
array
(
'type'
=>
'paragraph'
,
'item'
=>
$item
,
);
return
$this
;
}
public
function
addList
(
PhutilConsoleList
$list
)
{
$this
->
items
[]
=
array
(
'type'
=>
'list'
,
'item'
=>
$list
,
);
return
$this
;
}
protected
function
drawView
()
{
$output
=
array
();
foreach
(
$this
->
items
as
$spec
)
{
$type
=
$spec
[
'type'
];
$item
=
$spec
[
'item'
];
switch
(
$type
)
{
case
'paragraph'
:
$item
=
array
(
tsprintf
(
'%s'
,
$item
)->
applyWrap
(),
"
\n
"
,
);
break
;
case
'list'
:
$item
=
$item
;
break
;
}
$output
[]
=
$item
;
}
return
$this
->
drawLines
(
$output
);
}
}
Event Timeline
Log In to Comment