You are here

function WordLevelDiff::closing in Diff 6

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. 7.3 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 1018

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;
}