public function WordLevelDiff::__construct

public WordLevelDiff::__construct($orig_lines, $closing_lines)

Constructor.

Computes diff between sequences of strings.

This can be used to compute things like case-insensitive diffs, or diffs which ignore changes in white-space.

Parameters

$from_lines array An array of strings.: (Typically these are lines from a file.)

$to_lines array An array of strings.:

$mapped_from_lines array 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.

$mapped_to_lines array This array should: have the same number of elements as $to_lines.

Overrides MappedDiff::__construct

File

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

Class

WordLevelDiff
@todo document @private @subpackage DifferenceEngine

Namespace

Drupal\Component\Diff

Code

public function __construct($orig_lines, $closing_lines) {
  list($orig_words, $orig_stripped) = $this->_split($orig_lines);
  list($closing_words, $closing_stripped) = $this->_split($closing_lines);

  parent::__construct($orig_words, $closing_words, $orig_stripped, $closing_stripped);
}

© 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::__construct/8.1.x