Lggr
Public Member Functions | List of all members
SebastianBergmann\Diff\Differ Class Reference

Public Member Functions

 __construct ($outputBuilder=null)
 
 diff ($from, $to, LongestCommonSubsequenceCalculator $lcs=null)
 
 diffToArray ($from, $to, LongestCommonSubsequenceCalculator $lcs=null)
 

Detailed Description

Diff implementation.

Constructor & Destructor Documentation

◆ __construct()

SebastianBergmann\Diff\Differ::__construct (   $outputBuilder = null)
Parameters
DiffOutputBuilderInterface$outputBuilder
Exceptions
InvalidArgumentException

Member Function Documentation

◆ diff()

SebastianBergmann\Diff\Differ::diff (   $from,
  $to,
LongestCommonSubsequenceCalculator  $lcs = null 
)

Returns the diff between two arrays or strings as string.

Parameters
array | string$from
array | string$to
LongestCommonSubsequenceCalculator | null$lcs
Returns
string

◆ diffToArray()

SebastianBergmann\Diff\Differ::diffToArray (   $from,
  $to,
LongestCommonSubsequenceCalculator  $lcs = null 
)

Returns the diff between two arrays or strings as array.

Each array element contains two elements:

  • [0] => mixed $token
  • [1] => 2|1|0

2: REMOVED: $token was removed from $from

  • 1: ADDED: $token was added to $from
  • 0: OLD: $token is not changed in $to
Parameters
array | string$from
array | string$to
LongestCommonSubsequenceCalculator$lcs
Returns
array

The documentation for this class was generated from the following file: