Skip to content

Commit 1ef1948

Browse files
authored
Merge pull request #22 from JBlond/development
Development
2 parents d445336 + 47b8a7b commit 1ef1948

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

lib/jblond/Diff/Renderer/Text/Context.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ public function render(): string
7070
}
7171

7272
if ($hasVisible) {
73-
foreach ($group as $code) {
74-
list($tag, $i1, $i2, $j1, $j2) = $code;
73+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
7574
if ($tag == 'insert') {
7675
continue;
7776
}
@@ -95,8 +94,7 @@ public function render(): string
9594
$diff .= $separator;
9695

9796
if ($hasVisible) {
98-
foreach ($group as $code) {
99-
list($tag, $i1, $i2, $j1, $j2) = $code;
97+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
10098
if ($tag == 'delete') {
10199
continue;
102100
}

lib/jblond/Diff/Renderer/Text/Unified.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public function render(): string
4646
}
4747

4848
$diff .= '@@ -' . ($i1 + 1) . ',' . ($i2 - $i1) . ' +' . ($j1 + 1) . ',' . ($j2 - $j1) . " @@\n";
49-
foreach ($group as $code) {
50-
list($tag, $i1, $i2, $j1, $j2) = $code;
49+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
5150
if ($tag == 'equal') {
5251
$diff .= ' ' .
5352
implode(

lib/jblond/Diff/SequenceMatcher.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ function ($aArray, $bArray) {
417417
$j1 = 0;
418418
$k1 = 0;
419419
$nonAdjacent = array();
420-
foreach ($matchingBlocks as $block) {
421-
list($list4, $list5, $list6) = $block;
420+
foreach ($matchingBlocks as [$list4, $list5, $list6]) {
422421
if ($i1 + $k1 == $list4 && $j1 + $k1 == $list5) {
423422
$k1 += $list6;
424423
} else {
@@ -487,8 +486,7 @@ public function getOpCodes(): array
487486
$this->opCodes = array();
488487

489488
$blocks = $this->getMatchingBlocks();
490-
foreach ($blocks as $block) {
491-
list($ai, $bj, $size) = $block;
489+
foreach ($blocks as [$ai, $bj, $size]) {
492490
$tag = '';
493491
if ($i < $ai && $j < $bj) {
494492
$tag = 'replace';
@@ -579,8 +577,7 @@ public function getGroupedOpCodes(int $context = 3): array
579577
$groups = array();
580578
$group = array();
581579

582-
foreach ($opCodes as $code) {
583-
list($tag, $i1, $i2, $j1, $j2) = $code;
580+
foreach ($opCodes as [$tag, $i1, $i2, $j1, $j2]) {
584581
if ($tag == 'equal' && $i2 - $i1 > $maxRange) {
585582
$group[] = array(
586583
$tag,

0 commit comments

Comments
 (0)