Skip to content

Commit aed258f

Browse files
committed
remove list, but use an array
1 parent 84941b3 commit aed258f

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

lib/jblond/Diff/Renderer/Html/HtmlArray.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ public function render()
9595
$blocks = array();
9696
$lastTag = null;
9797
$lastBlock = 0;
98-
foreach ($group as $code) {
99-
list($tag, $i1, $i2, $j1, $j2) = $code;
98+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
10099

101100
if ($tag == 'replace' && $i2 - $i1 == $j2 - $j1) {
102101
for ($i = 0; $i < ($i2 - $i1); ++$i) {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public function render(): string
6868
}
6969

7070
if ($hasVisible) {
71-
foreach ($group as $code) {
72-
list($tag, $i1, $i2, $j1, $j2) = $code;
71+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
7372
if ($tag == 'insert') {
7473
continue;
7574
}
@@ -89,8 +88,7 @@ public function render(): string
8988
$diff .= $separator;
9089

9190
if ($hasVisible) {
92-
foreach ($group as $code) {
93-
list($tag, $i1, $i2, $j1, $j2) = $code;
91+
foreach ($group as [$tag, $i1, $i2, $j1, $j2]) {
9492
if ($tag == 'delete') {
9593
continue;
9694
}

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

Lines changed: 1 addition & 2 deletions
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 .= ' ' . implode("\n ", $this->diff->getOld($i1, $i2)) . "\n";
5352
} else {

lib/jblond/Diff/SequenceMatcher.php

Lines changed: 1 addition & 2 deletions
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 {

0 commit comments

Comments
 (0)