You are here

function WordLevelDiff::closing in Diff 7.3

Same name and namespace in other branches
  1. 5.2 DiffEngine.php \WordLevelDiff::closing()
  2. 5 DiffEngine.php \WordLevelDiff::closing()
  3. 6.2 DiffEngine.php \WordLevelDiff::closing()
  4. 6 DiffEngine.php \WordLevelDiff::closing()
  5. 7.2 DiffEngine.php \WordLevelDiff::closing()

Get the closing set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

Return value

array The sequence of strings.

Overrides Diff::closing

File

./DiffEngine.php, line 1076
A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)

Class

WordLevelDiff
@todo document @private @subpackage DifferenceEngine

Code

function closing() {
  $closing = new _HWLDF_WordAccumulator();
  foreach ($this->edits as $edit) {
    if ($edit->type == 'copy') {
      $closing
        ->addWords($edit->closing);
    }
    elseif ($edit->closing) {
      $closing
        ->addWords($edit->closing, 'mark');
    }
  }
  $lines = $closing
    ->getLines();
  return $lines;
}