You are here

public function Diff::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/sebastian/diff/src/Diff.php \SebastianBergmann\Diff\Diff::__construct()
  2. 8 core/lib/Drupal/Component/Diff/Diff.php \Drupal\Component\Diff\Diff::__construct()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Diff/Diff.php \Drupal\Component\Diff\Diff::__construct()

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.:

1 call to Diff::__construct()
MappedDiff::__construct in core/lib/Drupal/Component/Diff/MappedDiff.php
Constructor.
1 method overrides Diff::__construct()
MappedDiff::__construct in core/lib/Drupal/Component/Diff/MappedDiff.php
Constructor.

File

core/lib/Drupal/Component/Diff/Diff.php, line 39
Contains \Drupal\Component\Diff\Diff.

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