You are here

function Diff::reverse in Diff 5.2

Same name and namespace in other branches
  1. 5 DiffEngine.php \Diff::reverse()
  2. 6.2 DiffEngine.php \Diff::reverse()
  3. 6 DiffEngine.php \Diff::reverse()
  4. 7.3 DiffEngine.php \Diff::reverse()
  5. 7.2 DiffEngine.php \Diff::reverse()

* Compute reversed Diff. * * SYNOPSIS: * * $diff = new Diff($lines1, $lines2); * $rev = $diff->reverse(); *

Return value

object A Diff object representing the inverse of the * original diff.

1 call to Diff::reverse()
Diff::_check in ./DiffEngine.php
* Check a Diff for validity. * * This is here only for debugging purposes.

File

./DiffEngine.php, line 565

Class

Diff
Class representing a 'diff' between two sequences of strings. @todo document @private @subpackage DifferenceEngine

Code

function reverse() {
  $rev = $this;
  $rev->edits = array();
  foreach ($this->edits as $edit) {
    $rev->edits[] = $edit
      ->reverse();
  }
  return $rev;
}