Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
selectLcsImplementation example
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
)
;
if
(
$lcs
=== null
)
{
$lcs
=
$this
->
selectLcsImplementation
(
$from
,
$to
)
;
}
$common
=
$lcs
->
calculate
(
array_values
(
$from
)
,
array_values
(
$to
)
)
;
$diff
=
[
]
;
foreach
(
$start
as
$token
)
{
$diff
[
]
=
[
$token
, self::OLD
]
;
}
reset
(
$from
)
;
reset
(
$to
)
;