Skip to content

Commit 188f258

Browse files
committed
Add statistics function for #97 "equal" in the switch rather than "notModified"
1 parent ed1f204 commit 188f258

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

example/example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function changeCSS(cssFile, cssLinkIndex) {
7777
?>% match.<br>
7878
Inserted lines: <?php echo $stats['inserted']; ?><br>
7979
Deleted lines: <?php echo $stats['deleted']; ?><br>
80-
Not modified lines: <?php echo $stats['notModified']; ?><br>
80+
Not modified lines: <?php echo $stats['equal']; ?><br>
8181
Lines with replacement: <?php echo $stats['replaced']; ?><br>
8282
</aside>
8383
<hr>

lib/jblond/Diff/Similarity.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ private function ratioReduce(int $sum, array $triple): int
232232
public function getDifference(): array
233233
{
234234
$return = [
235-
'inserted' => 0,
236-
'deleted' => 0,
237-
'notModified' => 0,
238-
'replaced' => 0,
235+
'inserted' => 0,
236+
'deleted' => 0,
237+
'equal' => 0,
238+
'replaced' => 0,
239239
];
240240

241241
foreach ($this->getGroupedOpCodes() as $chunk) {
@@ -254,7 +254,7 @@ public function getDifference(): array
254254
}
255255
}
256256

257-
$return['notModified'] = count($this->old) - $return['replaced'] - $return['deleted'];
257+
$return['equal'] = count($this->old) - $return['replaced'] - $return['deleted'];
258258

259259
return $return;
260260
}

tests/Diff/SimilarityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testGetDifference(): void
4242
[
4343
'inserted' => 13,
4444
'deleted' => 1,
45-
'notModified' => 10,
45+
'equal' => 10,
4646
'replaced' => 0,
4747
],
4848
$similarity->getDifference()

0 commit comments

Comments
 (0)