Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setDefaultCrossingChar example
/** * @return array<string, TableStyle> */
private
static
function
initStyles
(
)
: array
{
$borderless
=
new
TableStyle
(
)
;
$borderless
->
setHorizontalBorderChars
(
'='
)
->
setVerticalBorderChars
(
' '
)
->
setDefaultCrossingChar
(
' '
)
;
$compact
=
new
TableStyle
(
)
;
$compact
->
setHorizontalBorderChars
(
''
)
->
setVerticalBorderChars
(
''
)
->
setDefaultCrossingChar
(
''
)
->
setCellRowContentFormat
(
'%s '
)
;
$styleGuide
=
new
TableStyle
(
)
;
/** * @return array<string, TableStyle> */
private
static
function
initStyles
(
)
: array
{
$borderless
=
new
TableStyle
(
)
;
$borderless
->
setHorizontalBorderChars
(
'='
)
->
setVerticalBorderChars
(
' '
)
->
setDefaultCrossingChar
(
' '
)
;
$compact
=
new
TableStyle
(
)
;
$compact
->
setHorizontalBorderChars
(
''
)
->
setVerticalBorderChars
(
''
)
->
setDefaultCrossingChar
(
''
)
->
setCellRowContentFormat
(
'%s '
)
;
$styleGuide
=
new
TableStyle
(
)
;
TABLE;
$this
->
assertEquals
(
$expected
,
$this
->
getOutputContent
(
$output
)
)
;
}
public
function
testStyle
(
)
{
$style
=
new
TableStyle
(
)
;
$style
->
setHorizontalBorderChars
(
'.'
)
->
setVerticalBorderChars
(
'.'
)
->
setDefaultCrossingChar
(
'.'
)
;
Table::
setStyleDefinition
(
'dotfull',
$style
)
;
$table
=
new
Table
(
$output
=
$this
->
getOutputStream
(
)
)
;
$table
->
setHeaders
(
[
'Foo'
]
)
->
setRows
(
[
[
'Bar'
]
]
)
->
setStyle
(
'dotfull'
)
;
$table
->
render
(
)
;
$expected
=