Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
splitStringByLines example
public
function
diffToArray
(
$from
,
$to
, LongestCommonSubsequenceCalculator
$lcs
= null
)
: array
{
if
(
is_string
(
$from
)
)
{
$from
=
$this
->
splitStringByLines
(
$from
)
;
}
elseif
(
!
is_array
(
$from
)
)
{
throw
new
InvalidArgumentException
(
'"from" must be an array or string.'
)
;
}
if
(
is_string
(
$to
)
)
{
$to
=
$this
->
splitStringByLines
(
$to
)
;
}
elseif
(
!
is_array
(
$to
)
)
{
throw
new
InvalidArgumentException
(
'"to" must be an array or string.'
)
;
}
[
$from
,
$to
,
$start
,
$end
]
= self::
getArrayDiffParted
(
$from
,
$to
)
;