1212 *
1313 * PHP version 7.2 or greater
1414 *
15- * @package jblond\Diff\Renderer\Html
16- * @author Chris Boulton <[email protected] > 17- * @author Mario Brandt <[email protected] > 18- * @author Ferry Cools <[email protected] > 15+ * @package jblond\Diff\Renderer\Html
16+ * @author Chris Boulton <[email protected] > 17+ * @author Mario Brandt <[email protected] > 18+ * @author Ferry Cools <[email protected] > 1919 * @copyright (c) 2009 Chris Boulton
20- * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
21- * @version 2.2.1
22- * @link https://github.com/JBlond/php-diff
20+ * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
21+ * @version 2.2.1
22+ * @link https://github.com/JBlond/php-diff
2323 */
2424class SideBySide extends MainRenderer implements SubRendererInterface
2525{
@@ -43,7 +43,7 @@ class SideBySide extends MainRenderer implements SubRendererInterface
4343 /**
4444 * SideBySide constructor.
4545 *
46- * @param array $options Custom defined options for the inline diff renderer.
46+ * @param array $options Custom defined options for the inline diff renderer.
4747 *
4848 * @see Inline::$subOptions
4949 */
@@ -103,27 +103,30 @@ public function generateSkippedLines(): string
103103 /**
104104 * Generate a string representation of table rows with lines without differences between both versions.
105105 *
106- * @param array $changes Contains the op-codes about the changes between two blocks.
106+ * Note: Depending on the options, lines can be marked as being equal, while the contents actually differ.
107+ * (E.g. ignoreWhitespace and ignoreCase)
108+ *
109+ * @param array $changes Contains the op-codes about the changes between two blocks.
107110 *
108111 * @return string HTML code representing table rows showing text with no difference.
109112 */
110113 public function generateLinesEqual (array $ changes ): string
111114 {
112115 $ html = '' ;
113116
114- foreach ($ changes ['base ' ]['lines ' ] as $ lineNo => $ line ) {
117+ foreach ($ changes ['base ' ]['lines ' ] as $ lineNo => $ baseLine ) {
115118 $ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
116119 $ toLine = $ changes ['changed ' ]['offset ' ] + $ lineNo + 1 ;
117120
118121 $ html .= <<<HTML
119122<tr>
120123 <th> $ fromLine</th>
121124 <td class="Left">
122- <span> $ line </span>
125+ <span> $ baseLine </span>
123126 </td>
124127 <th> $ toLine</th>
125128 <td class="Right">
126- <span> $ line </span>
129+ <span> { $ changes [ ' changed ' ][ ' lines ' ][ $ lineNo ]} </span>
127130 </td>
128131</tr>
129132HTML ;
@@ -135,7 +138,7 @@ public function generateLinesEqual(array $changes): string
135138 /**
136139 * Generates a string representation of table rows with lines that are added to the 2nd version.
137140 *
138- * @param array $changes Contains the op-codes about the changes between two blocks of text.
141+ * @param array $changes Contains the op-codes about the changes between two blocks of text.
139142 *
140143 * @return string HTML code representing table rows showing with added text.
141144 */
@@ -164,7 +167,7 @@ public function generateLinesInsert(array $changes): string
164167 /**
165168 * Generates a string representation of table rows with lines that are removed from the 2nd version.
166169 *
167- * @param array $changes Contains the op-codes about the changes between two blocks of text.
170+ * @param array $changes Contains the op-codes about the changes between two blocks of text.
168171 *
169172 * @return string HTML code representing table rows showing removed text.
170173 */
@@ -193,7 +196,7 @@ public function generateLinesDelete(array $changes): string
193196 /**
194197 * Generates a string representation of table rows with lines that are partially modified.
195198 *
196- * @param array $changes Contains the op-codes about the changes between two blocks of text.
199+ * @param array $changes Contains the op-codes about the changes between two blocks of text.
197200 *
198201 * @return string Html code representing table rows showing modified text.
199202 */
@@ -264,7 +267,7 @@ public function generateLinesReplace(array $changes): string
264267 /**
265268 * Generate a string representation of the start of a block.
266269 *
267- * @param array $changes Contains the op-codes about the changes between two blocks of text.
270+ * @param array $changes Contains the op-codes about the changes between two blocks of text.
268271 *
269272 * @return string Start of the diff view.
270273 */
@@ -276,7 +279,7 @@ public function generateBlockHeader(array $changes): string
276279 /**
277280 * Generate a string representation of the end of a block.
278281 *
279- * @param array $changes Contains the op-codes about the changes between two blocks of text.
282+ * @param array $changes Contains the op-codes about the changes between two blocks of text.
280283 *
281284 * @return string End of the block.
282285 */
0 commit comments