Home
last modified time | relevance | path

Searched refs:diff (Results 1 – 3 of 3) sorted by relevance

/PHP-Parser/test/PhpParser/Internal/
H A DDifferTest.php6 private function formatDiffString(array $diff) { argument
8 foreach ($diff as $diffElem) {
35 $diff = $differ->diff(str_split($oldStr), str_split($newStr));
36 $this->assertSame($expectedDiffStr, $this->formatDiffString($diff));
56 $diff = $differ->diffWithReplacements(str_split($oldStr), str_split($newStr));
57 $this->assertSame($expectedDiffStr, $this->formatDiffString($diff));
73 $diff = $differ->diff([0 => 'a', 2 => 'b'], [0 => 'a', 3 => 'b']);
77 ], $diff);
/PHP-Parser/lib/PhpParser/Internal/
H A DDiffer.php35 public function diff(array $old, array $new): array { function in PhpParser\\Internal\\Differ
54 return $this->coalesceReplacements($this->diff($old, $new));
139 * @param DiffElem[] $diff
142 private function coalesceReplacements(array $diff): array { argument
144 $c = \count($diff);
146 $diffType = $diff[$i]->type;
148 $newDiff[] = $diff[$i];
153 while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) {
158 while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) {
166 DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new
[all …]
/PHP-Parser/lib/PhpParser/
H A DPrettyPrinterAbstract.php783 $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes);
814 foreach ($diff as $i => $diffElem) {

Completed in 15 milliseconds