diff --git a/README.md b/README.md
index 581f8ed4..bfeff7d6 100644
--- a/README.md
+++ b/README.md
@@ -181,13 +181,13 @@ $result = $diff->render($renderer);
[
{
"tag": "rep",
- "base": {
+ "old": {
"offset": 0,
"lines": [
"<p>Hello World!</p>"
]
},
- "changed": {
+ "new": {
"offset": 0,
"lines": [
"<div>Hello World!</div>"
@@ -196,13 +196,13 @@ $result = $diff->render($renderer);
},
{
"tag": "eq",
- "base": {
+ "old": {
"offset": 1,
"lines": [
"~~~~~~~~~~~~~~~~~~~"
]
},
- "changed": {
+ "new": {
"offset": 1,
"lines": [
"~~~~~~~~~~~~~~~~~~~"
@@ -211,11 +211,11 @@ $result = $diff->render($renderer);
},
{
"tag": "ins",
- "base": {
+ "old": {
"offset": 2,
"lines": []
},
- "changed": {
+ "new": {
"offset": 2,
"lines": [
"Let's add a new line here."
@@ -224,13 +224,13 @@ $result = $diff->render($renderer);
},
{
"tag": "eq",
- "base": {
+ "old": {
"offset": 2,
"lines": [
"X"
]
},
- "changed": {
+ "new": {
"offset": 3,
"lines": [
"X"
@@ -241,13 +241,13 @@ $result = $diff->render($renderer);
[
{
"tag": "eq",
- "base": {
+ "old": {
"offset": 6,
"lines": [
"N"
]
},
- "changed": {
+ "new": {
"offset": 7,
"lines": [
"N"
@@ -256,13 +256,13 @@ $result = $diff->render($renderer);
},
{
"tag": "rep",
- "base": {
+ "old": {
"offset": 7,
"lines": [
"Do you know in Chinese, \"金槍魚罐頭\" means tuna can."
]
},
- "changed": {
+ "new": {
"offset": 8,
"lines": [
"Do you know in Japanese, \"魚の缶詰\" means fish can."
@@ -271,14 +271,14 @@ $result = $diff->render($renderer);
},
{
"tag": "eq",
- "base": {
+ "old": {
"offset": 8,
"lines": [
"This is just a useless line.",
"G"
]
},
- "changed": {
+ "new": {
"offset": 9,
"lines": [
"This is just a useless line.",
@@ -288,26 +288,26 @@ $result = $diff->render($renderer);
},
{
"tag": "del",
- "base": {
+ "old": {
"offset": 10,
"lines": [
"// @todo Remember to delete this line"
]
},
- "changed": {
+ "new": {
"offset": 11,
"lines": []
}
},
{
"tag": "eq",
- "base": {
+ "old": {
"offset": 11,
"lines": [
"Say hello to my neighbors."
]
},
- "changed": {
+ "new": {
"offset": 11,
"lines": [
"Say hello to my neighbors."
diff --git a/src/Renderer/Html/AbstractHtml.php b/src/Renderer/Html/AbstractHtml.php
index 78137c72..a71c6e9c 100644
--- a/src/Renderer/Html/AbstractHtml.php
+++ b/src/Renderer/Html/AbstractHtml.php
@@ -80,8 +80,8 @@ public function getChanges(): array
if (!empty($lines = \array_slice($old, $i1, ($i2 - $i1)))) {
$formattedLines = $this->formatLines($lines);
- $blocks[$lastBlock]['base']['lines'] += $formattedLines;
- $blocks[$lastBlock]['changed']['lines'] += $formattedLines;
+ $blocks[$lastBlock]['old']['lines'] += $formattedLines;
+ $blocks[$lastBlock]['new']['lines'] += $formattedLines;
}
continue;
@@ -109,7 +109,7 @@ public function getChanges(): array
$lines
);
- $blocks[$lastBlock]['base']['lines'] += $lines;
+ $blocks[$lastBlock]['old']['lines'] += $lines;
}
if (
@@ -124,7 +124,7 @@ public function getChanges(): array
$lines
);
- $blocks[$lastBlock]['changed']['lines'] += $lines;
+ $blocks[$lastBlock]['new']['lines'] += $lines;
}
}
@@ -167,8 +167,8 @@ protected function renderChangedExtent(AbstractLineRenderer $lineRenderer, strin
* Get the default block.
*
* @param string $tag the operation tag
- * @param int $i1 begin index of the diff of the source
- * @param int $j1 begin index of the diff of the destination
+ * @param int $i1 begin index of the diff of the old array
+ * @param int $j1 begin index of the diff of the new array
*
* @return array the default block
*/
@@ -176,11 +176,11 @@ protected function getDefaultBlock(string $tag, int $i1, int $j1): array
{
return [
'tag' => $tag,
- 'base' => [
+ 'old' => [
'offset' => $i1,
'lines' => [],
],
- 'changed' => [
+ 'new' => [
'offset' => $j1,
'lines' => [],
],
diff --git a/src/Renderer/Html/Inline.php b/src/Renderer/Html/Inline.php
index 83f5f4c0..4483cf54 100644
--- a/src/Renderer/Html/Inline.php
+++ b/src/Renderer/Html/Inline.php
@@ -124,14 +124,14 @@ protected function renderTableEqual(array $change): string
{
$html = '';
- foreach ($change['base']['lines'] as $no => $line) {
- $oldLineNum = $change['base']['offset'] + $no + 1;
- $newLineNum = $change['changed']['offset'] + $no + 1;
+ foreach ($change['old']['lines'] as $no => $line) {
+ $oldLineNum = $change['old']['offset'] + $no + 1;
+ $newLineNum = $change['new']['offset'] + $no + 1;
$html .=
'