W3cubDocs

/Drupal 8

public function Diff::__construct

public Diff::__construct($from_lines, $to_lines)

Constructor. Computes diff between sequences of strings.

Parameters

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

$to_lines array An array of strings.:

File

core/lib/Drupal/Component/Diff/Diff.php, line 34

Class

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

Namespace

Drupal\Component\Diff

Code

public function __construct($from_lines, $to_lines) {
  $eng = new DiffEngine();
  $this->edits = $eng->diff($from_lines, $to_lines);
  //$this->_check($from_lines, $to_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!Diff.php/function/Diff::__construct/8.1.x