function Differ::diffWithReplacements
Same name in this branch
- 11.1.x vendor/phpstan/phpdoc-parser/src/Printer/Differ.php \PHPStan\PhpDocParser\Printer\Differ::diffWithReplacements()
Calculate diff, including "replace" operations.
If a sequence of remove operations is followed by the same number of add operations, these will be coalesced into replace operations.
Parameters
T[] $old Original array:
T[] $new New array:
Return value
DiffElem[] Diff (edit script), including replace operations
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ Differ.php, line 53
Class
- Differ
- Implements the Myers diff algorithm.
Namespace
PhpParser\InternalCode
public function diffWithReplacements(array $old, array $new) : array {
return $this->coalesceReplacements($this->diff($old, $new));
}