Skip to content

Commit 73f6776

Browse files
committed
Fix redundant and unused code.
1 parent 3bc0839 commit 73f6776

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

lib/jblond/Diff/Renderer/MainRenderer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,10 @@ private function getOuterChange(string $oldString, string $newString): array
381381
*
382382
* The index of the last element of the array is always returned.
383383
*
384-
* @param array $blocks The array which keeps the changes for the HTML renderer.
385-
* @param string $tag Kind of difference.
386-
* @param integer $lineInOld Start of block in "old".
387-
* @param integer $lineInNew Start of block in "new".
384+
* @param array $blocks The array which keeps the changes for the HTML renderer.
385+
* @param string $tag Kind of difference.
386+
* @param int $lineInOld Start of block in "old".
387+
* @param int $lineInNew Start of block in "new".
388388
*
389389
* @return int The index of the last element.
390390
*/
@@ -437,7 +437,7 @@ function ($line) {
437437
// Convert special characters to HTML entities
438438
$strings = array_map(
439439
function ($line) {
440-
return htmlspecialchars($line, ENT_NOQUOTES, 'UTF-8');
440+
return htmlspecialchars($line, ENT_NOQUOTES);
441441
},
442442
$strings
443443
);
@@ -447,7 +447,7 @@ function ($line) {
447447
$line = preg_replace_callback(
448448
'/(^[ \0\1]*)/',
449449
function ($matches) {
450-
return str_replace(' ', " ", $matches[0]);
450+
return str_replace(' ', ' ', $matches[0]);
451451
},
452452
$line
453453
);

lib/jblond/Diff/Renderer/MainRendererAbstract.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @package jblond\Diff\Renderer
1515
* @author Mario Brandt <[email protected]>
1616
* @author Ferry Cools <[email protected]>
17-
* @copyright (c) 2009 Chris Boulton
17+
* @copyright (c) 2020 Ferry Cools
1818
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
1919
* @version 2.3.0
2020
* @link https://github.com/JBlond/php-diff
@@ -33,10 +33,6 @@ abstract class MainRendererAbstract
3333
* Mark line differences.
3434
*/
3535
public const CHANGE_LEVEL_LINE = 2;
36-
/**
37-
* Mark no inline differences.
38-
*/
39-
public const CHANGE_LEVEL_NONE = 4;
4036
/**
4137
* @var Diff $diff Instance of the diff class that this renderer is generating the rendered diff for.
4238
*/

0 commit comments

Comments
 (0)