Diff
class Diff (View source)
Class representing a 'diff' between two sequences of strings.
Properties
| protected DiffOp[] | $edits | The list of differences as an array of diff operations. |
Methods
Constructor.
Compute reversed Diff.
Check for empty diff.
Compute the length of the Longest Common Subsequence (LCS).
Gets the original set of lines.
Gets the closing set of lines.
Check a Diff for validity.
Details
__construct(array $from_lines, array $to_lines)
Constructor.
Computes diff between sequences of strings.
object
reverse()
Compute reversed Diff.
SYNOPSIS:
$diff = new Diff($lines1, $lines2); $rev = $diff->reverse();
bool
isEmpty()
Check for empty diff.
int
lcs()
Compute the length of the Longest Common Subsequence (LCS).
This is mostly for diagnostic purposed.
array
orig()
Gets the original set of lines.
This reconstructs the $from_lines parameter passed to the constructor.
array
closing()
Gets the closing set of lines.
This reconstructs the $to_lines parameter passed to the constructor.
check($from_lines, $to_lines)
Check a Diff for validity.
This is here only for debugging purposes.
DiffOp[]
getEdits()
Gets the list of differences as an array of diff operations.