public function WordLevelDiff::closing

public WordLevelDiff::closing()

Gets 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

core/lib/Drupal/Component/Diff/WordLevelDiff.php, line 67

Class

WordLevelDiff
@todo document @private @subpackage DifferenceEngine

Namespace

Drupal\Component\Diff

Code

public function closing() {
  $closing = new HWLDFWordAccumulator();

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Diff!WordLevelDiff.php/function/WordLevelDiff::closing/8.1.x