function Diff::__construct
Same name in this branch
- 11.1.x vendor/sebastian/diff/src/Diff.php \SebastianBergmann\Diff\Diff::__construct()
Constructor. Computes diff between sequences of strings.
Parameters
array $from_lines: An array of strings. (Typically these are lines from a file.)
array $to_lines: An array of strings.
2 calls to Diff::__construct()
- MappedDiff::__construct in core/
lib/ Drupal/ Component/ Diff/ MappedDiff.php - Constructor.
- 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 34
Class
- Diff
- Class representing a 'diff' between two sequences of strings.
Namespace
Drupal\Component\DiffCode
public function __construct($from_lines, $to_lines) {
$diffOpBuilder = new DiffOpOutputBuilder();
$differ = new Differ($diffOpBuilder);
$this->edits = $diffOpBuilder->toOpsArray($differ->diffToArray($from_lines, $to_lines));
}