sistemazione composer install

This commit is contained in:
mariano
2026-05-22 14:13:33 +02:00
parent ad42773519
commit ed29fbc62d
252 changed files with 52727 additions and 13 deletions
+6
View File
@@ -0,0 +1,6 @@
## Upgrading to v3
- `$diffOptions` removes: `charLevelDiff` and `separateBlock`.
- `$templateOptions` adds: `detailLevel` (similar to `charLevelDiff`, read docs) and `separateBlock` (exact the same one in `$diffOptions`).
- `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.)
- The look of "skipped" block in HTML renderers (`SideBySide` and `Inline`) have been changed. (You may have to tweak your CSS.)
+5
View File
@@ -0,0 +1,5 @@
## Upgrading to v4
- `Jfcherng\Diff\Utility\SequenceMatcher` becomes [a new package](https://packagist.org/packages/jfcherng/php-sequence-matcher) by the namespace of `Jfcherng\Diff\SequenceMatcher`.
- Factories under `Jfcherng\Diff\Utility\` are moved to `Jfcherng\Diff\Factory\`. For example, `Jfcherng\Diff\Utility\RendererFactory` is now `Jfcherng\Diff\Factory\RendererFactory`.
- 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.)
+24
View File
@@ -0,0 +1,24 @@
## Upgrading to v5
- Names involving `a, b`, `from, to`, `base, changed` have been renamed to `old, new` for consistency.
Here's some examples:
- `Diff::setAB()` becomes `Diff::setOldNew()`.
- `Diff::setA()` becomes `Diff::setOld()`.
- `Diff::setB()` becomes `Diff::setNew()`.
- `Diff::getA()` becomes `Diff::getOld()`.
- `Diff::getB()` becomes `Diff::getNew()`.
- `base`, `changed` keys in the result of the `Json` renderer have become `old`, `new`.
- In the result of HTML renderers, classes of rows of line numbers has been changed.
You may have to change your CSS if you have some customized things depend on these.
- `<th class="f-num">` (from-number) becomes `<th class="n-new">` (number-new).
- `<th class="t-num">` (to-number) becomes `<th class="n-old">` (number-old).
- The `tag` (sometimes called `op`) in `Json` template is now in `int` form by default.
To get previous behavior, set the renderer option `outputTagAsString` to `true`.
- The `tag` (sometimes called `op`) in `Diff::getGroupedOpcodes()`'s results are now in `int` form.
The corresponding meaning could be found in
[jfcherng/php-sequence-matcher](https://github.com/jfcherng/php-sequence-matcher/blob/3.0.0/src/SequenceMatcher.php#L16-L26).
+47
View File
@@ -0,0 +1,47 @@
## Upgrading to v6
### For Simple Users
If you only use the `DiffHelper` and built-in `Renderer`s,
there is no breaking change for you so you do not have to do anything.
### Breaking Changes for Normal Users
- The `Diff` class has been renamed as `Differ`.
It should be relatively easy to adapt to this by changing the class name.
- The term `template` has been renamed as `renderer`. Some examples are:
- Method `DiffHelper::getRenderersInfo()`
- Method `DiffHelper::getAvailableRenderers()`
- Constant `RendererConstant::RENDERER_TYPES`
- Constant `AbstractRenderer::IS_TEXT_RENDERER`
- Now a `Renderer` has a `render()` method, but a `Differ` does not.
(because it makes more sense saying a renderer would render something)
If you use those classes by yourself, it should be written like below.
```php
use Jfcherng\Diff\Differ;
use Jfcherng\Diff\Factory\RendererFactory;
$differ = new Differ(explode("\n", $old), explode("\n", $new), $diffOptions);
$renderer = RendererFactory::make($rendererName, $rendererOptions);
$result = $renderer->render($differ); // <-- this line has been changed
```
### Breaking Changes for Customized Renderer Developers
- Remove the deprecated `AbstractRenderer::getIdenticalResult()` and
add `RendererInterface::getResultForIdenticals()`. The returned value will be
directly used before actually starting to calculate diff if we find that the
two strings are the same. `AbstractRenderer::getResultForIdenticals()`
returns an empty string by default.
- Now a `Renderer` should implement `protected function renderWorker(Differ $differ): string`
rather than the previous `public function render(): string`. Note that
`$this->diff` no longer works in `Renderer`s as it is now injected as a
parameter to `Renderer::renderWorker()`.