diff options
Diffstat (limited to 'vendor/jfcherng/php-diff/UPGRADING')
4 files changed, 82 insertions, 0 deletions
diff --git a/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v3.md b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v3.md new file mode 100644 index 0000000..c3649d2 --- /dev/null +++ b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v3.md @@ -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.) diff --git a/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v4.md b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v4.md new file mode 100644 index 0000000..308d1a2 --- /dev/null +++ b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v4.md @@ -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.) diff --git a/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v5.md b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v5.md new file mode 100644 index 0000000..4c6c059 --- /dev/null +++ b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v5.md @@ -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). diff --git a/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v6.md b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v6.md new file mode 100644 index 0000000..8929ac4 --- /dev/null +++ b/vendor/jfcherng/php-diff/UPGRADING/UPGRADING_v6.md @@ -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()`. |