File tree Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ there is no breaking change for you so you do not have to do anything.
3434- If you call `Differ::getGroupedOpcodes()` by yourself,
3535 you must call `Differ::finalize()` before it.
3636
37+ - Add `RendererInterface::getResultForIdenticals()`.
38+ `AbstractRenderer::getResultForIdenticals()` returns an empty string by default.
39+
40+ - Remove the deprecated `AbstractRenderer::getIdenticalResult()`.
41+ Use /implement the `AbstractRenderer::getResultForIdenticals()` instead.
42+
3743
3844### Internal Breaking Changes
3945
Original file line number Diff line number Diff line change @@ -101,11 +101,9 @@ public function getOptions(): array
101101 }
102102
103103 /**
104- * Get the renderer result when the old and the new are the same.
105- *
106- * @return string
104+ * {@inheritdoc}
107105 */
108- public static function getIdenticalResult (): string
106+ public function getResultForIdenticals (): string
109107 {
110108 return '' ;
111109 }
@@ -119,7 +117,7 @@ public function render(Differ $differ): string
119117
120118 // the "no difference" situation may happen frequently
121119 return $ differ ->getOldNewComparison () === 0
122- ? static :: getIdenticalResult ()
120+ ? $ this -> getResultForIdenticals ()
123121 : $ this ->renderWoker ($ differ );
124122 }
125123
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ protected function renderWoker(Differ $differ): string
2828 $ changes = $ this ->getChanges ($ differ );
2929
3030 if (empty ($ changes )) {
31- return self :: getIdenticalResult ();
31+ return $ this -> getResultForIdenticals ();
3232 }
3333
3434 $ html = '<table class="diff diff-html diff-inline"> ' ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ final class Json extends AbstractHtml
2828 /**
2929 * {@inheritdoc}
3030 */
31- public static function getIdenticalResult (): string
31+ public function getResultForIdenticals (): string
3232 {
3333 return '[] ' ;
3434 }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ protected function renderWoker(Differ $differ): string
2828 $ changes = $ this ->getChanges ($ differ );
2929
3030 if (empty ($ changes )) {
31- return self :: getIdenticalResult ();
31+ return $ this -> getResultForIdenticals ();
3232 }
3333
3434 $ html = '<table class="diff diff-html diff-side-by-side"> ' ;
Original file line number Diff line number Diff line change 1111 */
1212interface RendererInterface
1313{
14+ /**
15+ * Get the renderer result when the old and the new are the same.
16+ *
17+ * @return string
18+ */
19+ public function getResultForIdenticals (): string ;
20+
1421 /**
1522 * Render the differ and return the result.
1623 *
You can’t perform that action at this time.
0 commit comments