From fab2a4308ed2451c192c6ee9227718147646e3ad Mon Sep 17 00:00:00 2001 From: JBlond Date: Tue, 8 Oct 2019 11:31:07 +0200 Subject: [PATCH 1/3] prepare 1.14 --- lib/jblond/Diff.php | 2 +- lib/jblond/Diff/Renderer/Html/HtmlArray.php | 2 +- lib/jblond/Diff/Renderer/Html/Inline.php | 2 +- lib/jblond/Diff/Renderer/Html/SideBySide.php | 2 +- lib/jblond/Diff/Renderer/RendererAbstract.php | 2 +- lib/jblond/Diff/Renderer/Text/Context.php | 2 +- lib/jblond/Diff/Renderer/Text/Unified.php | 2 +- lib/jblond/Diff/SequenceMatcher.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/jblond/Diff.php b/lib/jblond/Diff.php index 72b8524c..0afee790 100644 --- a/lib/jblond/Diff.php +++ b/lib/jblond/Diff.php @@ -18,7 +18,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class Diff diff --git a/lib/jblond/Diff/Renderer/Html/HtmlArray.php b/lib/jblond/Diff/Renderer/Html/HtmlArray.php index 0dae8509..f327f0f2 100644 --- a/lib/jblond/Diff/Renderer/Html/HtmlArray.php +++ b/lib/jblond/Diff/Renderer/Html/HtmlArray.php @@ -15,7 +15,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class HtmlArray extends RendererAbstract diff --git a/lib/jblond/Diff/Renderer/Html/Inline.php b/lib/jblond/Diff/Renderer/Html/Inline.php index 7696eb32..8bfcef4b 100644 --- a/lib/jblond/Diff/Renderer/Html/Inline.php +++ b/lib/jblond/Diff/Renderer/Html/Inline.php @@ -13,7 +13,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class Inline extends HtmlArray diff --git a/lib/jblond/Diff/Renderer/Html/SideBySide.php b/lib/jblond/Diff/Renderer/Html/SideBySide.php index acf2984a..f69e898c 100644 --- a/lib/jblond/Diff/Renderer/Html/SideBySide.php +++ b/lib/jblond/Diff/Renderer/Html/SideBySide.php @@ -13,7 +13,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class SideBySide extends HtmlArray diff --git a/lib/jblond/Diff/Renderer/RendererAbstract.php b/lib/jblond/Diff/Renderer/RendererAbstract.php index d04210f2..dbb15067 100644 --- a/lib/jblond/Diff/Renderer/RendererAbstract.php +++ b/lib/jblond/Diff/Renderer/RendererAbstract.php @@ -15,7 +15,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ abstract class RendererAbstract diff --git a/lib/jblond/Diff/Renderer/Text/Context.php b/lib/jblond/Diff/Renderer/Text/Context.php index 813e478e..d2bfbd5f 100644 --- a/lib/jblond/Diff/Renderer/Text/Context.php +++ b/lib/jblond/Diff/Renderer/Text/Context.php @@ -15,7 +15,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class Context extends RendererAbstract diff --git a/lib/jblond/Diff/Renderer/Text/Unified.php b/lib/jblond/Diff/Renderer/Text/Unified.php index bfeb05e9..ed838354 100644 --- a/lib/jblond/Diff/Renderer/Text/Unified.php +++ b/lib/jblond/Diff/Renderer/Text/Unified.php @@ -15,7 +15,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ diff --git a/lib/jblond/Diff/SequenceMatcher.php b/lib/jblond/Diff/SequenceMatcher.php index 2f48466d..d8608834 100644 --- a/lib/jblond/Diff/SequenceMatcher.php +++ b/lib/jblond/Diff/SequenceMatcher.php @@ -13,7 +13,7 @@ * @author Chris Boulton * @copyright (c) 2009 Chris Boulton * @license New BSD License http://www.opensource.org/licenses/bsd-license.php - * @version 1.13 + * @version 1.14 * @link https://github.com/JBlond/php-diff */ class SequenceMatcher From 1cc43c3cf58a0f8fd55780a0e4a2161b3a654671 Mon Sep 17 00:00:00 2001 From: JBlond Date: Tue, 3 Dec 2019 18:01:23 +0100 Subject: [PATCH 2/3] some code clean up --- example/example.php | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/example/example.php b/example/example.php index 6a6b516a..718494f5 100644 --- a/example/example.php +++ b/example/example.php @@ -3,19 +3,26 @@ PHP LibDiff - Examples - +

PHP LibDiff - Examples


Side by Side Diff

'Custom title for OLD version', 'title_b' => 'Custom title for NEW version', )); @@ -42,7 +51,8 @@ render($renderer); ?> @@ -50,7 +60,8 @@
render($renderer));
 
         ?>
@@ -59,7 +70,8 @@
         
render($renderer));
         ?>
         
From 49e2c3acdd514b70582d258ec042a1f86a453d29 Mon Sep 17 00:00:00 2001 From: JBlond Date: Tue, 3 Dec 2019 18:10:17 +0100 Subject: [PATCH 3/3] remove unused function --- example/styles.css | 6 +----- lib/jblond/Diff/Renderer/Html/HtmlArray.php | 3 --- lib/jblond/Diff/Renderer/Html/Inline.php | 15 --------------- lib/jblond/Diff/Renderer/Html/SideBySide.php | 14 -------------- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/example/styles.css b/example/styles.css index 5454896f..dd64e6a8 100644 --- a/example/styles.css +++ b/example/styles.css @@ -65,10 +65,6 @@ body { background: #fc0; } -.Differences .Skipped { - background: #f7f7f7; -} - .DifferencesInline .ChangeReplace .Left, .DifferencesInline .ChangeDelete .Left { background: #fdd; @@ -90,4 +86,4 @@ body { pre { width: 100%; overflow: auto; -} \ No newline at end of file +} diff --git a/lib/jblond/Diff/Renderer/Html/HtmlArray.php b/lib/jblond/Diff/Renderer/Html/HtmlArray.php index f327f0f2..8ddd6656 100644 --- a/lib/jblond/Diff/Renderer/Html/HtmlArray.php +++ b/lib/jblond/Diff/Renderer/Html/HtmlArray.php @@ -47,9 +47,6 @@ public function renderHtml($changes, $object) // If this is a separate block, we're condensing code so output ..., // indicating a significant portion of the code has been collapsed as // it is the same - if ($i > 0) { - $html .= $object->generateSkippedTable(); - } foreach ($blocks as $change) { $html .= ''; diff --git a/lib/jblond/Diff/Renderer/Html/Inline.php b/lib/jblond/Diff/Renderer/Html/Inline.php index 8bfcef4b..a7f0cdb7 100644 --- a/lib/jblond/Diff/Renderer/Html/Inline.php +++ b/lib/jblond/Diff/Renderer/Html/Inline.php @@ -50,21 +50,6 @@ public function generateTableHeader(): string return $html; } - /** - * Generates a string representation of empty table body. - * - * @return string Html code representing empty table body. - */ - public function generateSkippedTable(): string - { - $html = ''; - $html .= '…'; - $html .= '…'; - $html .= ' '; - $html .= ''; - return $html; - } - /** * Generates a string representation of one or more rows of a table of lines of text with no difference. * diff --git a/lib/jblond/Diff/Renderer/Html/SideBySide.php b/lib/jblond/Diff/Renderer/Html/SideBySide.php index f69e898c..2e036117 100644 --- a/lib/jblond/Diff/Renderer/Html/SideBySide.php +++ b/lib/jblond/Diff/Renderer/Html/SideBySide.php @@ -48,20 +48,6 @@ public function generateTableHeader(): string return $html; } - /** - * Generates a string representation of empty table body. - * - * @return string Html code representing empty table body. - */ - public function generateSkippedTable(): string - { - $html = ''; - $html .= '… '; - $html .= '… '; - $html .= ''; - return $html; - } - /** * Generates a string representation of one or more rows of a table of lines of text with no difference. *