Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
toByteString example
$lines
[
$i
]
=
$this
->styleStack->
getCurrent
(
)
->
apply
(
$line
)
;
}
}
return
implode
(
"\n",
$lines
)
;
}
private
function
addLineBreaks
(
string
$text
, int
$width
)
: string
{
$encoding
=
mb_detect_encoding
(
$text
, null, true
)
?: 'UTF-8';
return
b
(
$text
)
->
toCodePointString
(
$encoding
)
->
wordwrap
(
$width
, "\n", true
)
->
toByteString
(
$encoding
)
;
}
}
$lines
[
$i
]
=
$this
->styleStack->
getCurrent
(
)
->
apply
(
$line
)
;
}
}
return
implode
(
"\n",
$lines
)
;
}
private
function
addLineBreaks
(
string
$text
, int
$width
)
: string
{
$encoding
=
mb_detect_encoding
(
$text
, null, true
)
?: 'UTF-8';
return
b
(
$text
)
->
toCodePointString
(
$encoding
)
->
wordwrap
(
$width
, "\n", true
)
->
toByteString
(
$encoding
)
;
}
}