1
1
<?php
2
+ declare (strict_types=1 );
2
3
namespace jblond \Diff \Renderer \Html ;
3
4
4
5
/**
38
39
* @author Chris Boulton <[email protected] >
39
40
* @copyright (c) 2009 Chris Boulton
40
41
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
41
- * @version 1.5
42
+ * @version 1.6
42
43
* @link https://github.com/JBlond/php-diff
43
44
*/
44
45
@@ -53,7 +54,7 @@ class SideBySide extends HtmlArray
53
54
*
54
55
* @return string The generated side by side diff.
55
56
*/
56
- public function render ()
57
+ public function render () : string
57
58
{
58
59
$ changes = parent ::render ();
59
60
@@ -102,7 +103,7 @@ public function render()
102
103
*
103
104
* @return string Html code representation of the table's header.
104
105
*/
105
- private function generateTableHeader ()
106
+ private function generateTableHeader () : string
106
107
{
107
108
$ html = '<table class="Differences DifferencesSideBySide"> ' ;
108
109
$ html .= '<thead> ' ;
@@ -119,7 +120,7 @@ private function generateTableHeader()
119
120
*
120
121
* @return string Html code representing empty table body.
121
122
*/
122
- private function generateSkippedTable ()
123
+ private function generateSkippedTable () : string
123
124
{
124
125
$ html = '<tbody class="Skipped"> ' ;
125
126
$ html .= '<th>…</th><td> </td> ' ;
@@ -134,7 +135,7 @@ private function generateSkippedTable()
134
135
* @param array &$change Array with data about changes.
135
136
* @return string Html code representing one or more rows of text with no difference.
136
137
*/
137
- private function generateTableRowsEqual (&$ change )
138
+ private function generateTableRowsEqual (&$ change ) : string
138
139
{
139
140
$ html = "" ;
140
141
foreach ($ change ['base ' ]['lines ' ] as $ no => $ line ) {
@@ -156,7 +157,7 @@ private function generateTableRowsEqual(&$change)
156
157
* @param array &$change Array with data about changes.
157
158
* @return string Html code representing one or more rows of added text.
158
159
*/
159
- private function generateTableRowsInsert (&$ change )
160
+ private function generateTableRowsInsert (&$ change ) : string
160
161
{
161
162
$ html = "" ;
162
163
foreach ($ change ['changed ' ]['lines ' ] as $ no => $ line ) {
@@ -177,7 +178,7 @@ private function generateTableRowsInsert(&$change)
177
178
* @param array &$change Array with data about changes.
178
179
* @return string Html code representing one or more rows of removed text.
179
180
*/
180
- private function generateTableRowsDelete (&$ change )
181
+ private function generateTableRowsDelete (&$ change ) : string
181
182
{
182
183
$ html = "" ;
183
184
foreach ($ change ['base ' ]['lines ' ] as $ no => $ line ) {
@@ -198,7 +199,7 @@ private function generateTableRowsDelete(&$change)
198
199
* @param array &$change Array with data about changes.
199
200
* @return string Html code representing one or more rows of modified.
200
201
*/
201
- private function generateTableRowsReplace (&$ change )
202
+ private function generateTableRowsReplace (&$ change ) : string
202
203
{
203
204
$ html = "" ;
204
205
0 commit comments