Skip to content

Commit dbcf0b8

Browse files
committed
Update readme
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent b84bef5 commit dbcf0b8

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ $result = $diff->render($renderer);
174174

175175
## Renderer: JSON
176176

177-
<details><summary>Click to expand the result</summary>
177+
<details><summary>Click to expand</summary>
178178

179179
```javascript
180180
[
@@ -322,20 +322,41 @@ $result = $diff->render($renderer);
322322
# Upgrading
323323

324324

325-
## From v2 to v3
325+
<details><summary>From v2 to v3</summary>
326326

327327
- `$diffOptions` removes: `charLevelDiff` and `separateBlock`.
328328
- `$templateOptions` adds: `detailLevel` (similar to `charLevelDiff`, read docs) and `separateBlock` (exact the same one in `$diffOptions`).
329329
- `Jfcherng\Diff\Diff`'s `$a` (`$old`), `$b` (`$new`) are required in `__construct()`. (You may pass two empty arrays if you do not want to do anything at that moment.)
330330
- The look of "skipped" block in HTML renderers (`SideBySide` and `Inline`) have been changed. (You may have to tweak your CSS.)
331331

332+
</details>
332333

333-
## From v3 to v4
334+
<details><summary>From v3 to v4</summary>
334335

335336
- `Jfcherng\Diff\Utility\SequenceMatcher` becomes [a new package](https://packagist.org/packages/jfcherng/php-sequence-matcher) by the namespace of `Jfcherng\Diff\SequenceMatcher`.
336337
- Factories under `Jfcherng\Diff\Utility\` are moved to `Jfcherng\Diff\Factory\`. For example, `Jfcherng\Diff\Utility\RendererFactory` is now `Jfcherng\Diff\Factory\RendererFactory`.
337338
- Non-abstract classes are no longer inheritable as they are added with `final` keywords. (This allows me to do more internal changes without causing possible BC breaks.)
338339

340+
</details>
341+
342+
<details><summary>From v4 to v5</summary>
343+
344+
- Names involving `a, b`, `from, to`, `base, changed` have been renamed to `old, new` for consistency.
345+
Here's some examples:
346+
347+
- `Diff::setA()` becomes `Diff::setOld()`.
348+
- `Diff::setB()` becomes `Diff::setNew()`.
349+
- `Diff::setAB()` becomes `Diff::setOldNew()`.
350+
- `base`, `changed` keys in the result of the `Json` renderer have become `old`, `new`.
351+
352+
- In the result of HTML renderers, classes of rows of line numbers has been changed.
353+
You may have to change your CSS if you have some customized things depend on these.
354+
355+
- `<th class="f-num">` (from-number) becomes `<th class="n-new">` (number-new).
356+
- `<th class="t-num">` (to-number) becomes `<th class="n-old">` (number-old).
357+
358+
</details>
359+
339360

340361
# Acknowledgment
341362

0 commit comments

Comments
 (0)