Definition at line 201 of file Diff.php.
◆ __construct()
Text_MappedDiff::__construct |
( |
|
$from_lines, |
|
|
|
$to_lines, |
|
|
|
$mapped_from_lines, |
|
|
|
$mapped_to_lines |
|
) |
| |
Computes a diff between sequences of strings.
This can be used to compute things like case-insensitve diffs, or diffs which ignore changes in white-space.
- Parameters
-
array | $from_lines | An array of strings. |
array | $to_lines | An array of strings. |
array | $mapped_from_lines | This array should have the same size number of elements as $from_lines. The elements in $mapped_from_lines and $mapped_to_lines are what is actually compared when computing the diff. |
array | $mapped_to_lines | This array should have the same number of elements as $to_lines. |
Definition at line 220 of file Diff.php.
References $i, and $orig.
226 assert(count($from_lines) == count($mapped_from_lines));
227 assert(count($to_lines) == count($mapped_to_lines));
229 parent::__construct($mapped_from_lines, $mapped_to_lines);
232 for (
$i = 0;
$i < count($this->_edits);
$i++) {
233 $orig = &$this->_edits[
$i]->orig;
234 if (is_array(
$orig)) {
235 $orig = array_slice($from_lines, $xi, count(
$orig));
239 $final = &$this->_edits[
$i]->final;
240 if (is_array($final)) {
241 $final = array_slice($to_lines, $yi, count($final));
242 $yi += count($final);
The documentation for this class was generated from the following file:
- Services/XHTMLValidator/validator/Text_Diff/Diff.php