Skip to content

Commit e0cc8c3

Browse files
committed
correct type hint warnings
1 parent 9509231 commit e0cc8c3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/jblond/Diff/Renderer/Html/HtmlArray.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function mb_substr_replace($string, $replacement, $start, $length=NULL) {
9898
$length = array_pad(array($length), $num, $length);
9999
}
100100
// Recursive call
101-
return array_map(__FUNCTION__, $string, $replacement, $start, $length);
101+
return array_map(array($this, 'mb_substr_replace'), $string, $replacement, $start, $length);
102102
}
103103
preg_match_all('/./us', (string)$string, $smatches);
104104
preg_match_all('/./us', (string)$replacement, $rmatches);
@@ -112,7 +112,7 @@ public function mb_substr_replace($string, $replacement, $start, $length=NULL) {
112112
* based differences. Generally called by subclasses that generate a
113113
* HTML based diff and return an array of the changes to show in the diff.
114114
*
115-
* @return array An array of the generated changes, suitable for presentation in HTML.
115+
* @return array|string An array of the generated changes, suitable for presentation in HTML.
116116
*/
117117
public function render()
118118
{
@@ -250,12 +250,12 @@ protected function fixSpaces($matches)
250250
if($count == 0) {
251251
continue;
252252
}
253-
$div = floor($count / 2);
253+
$div = (int) floor($count / 2);
254254
$mod = $count % 2;
255255
$buffer .= str_repeat('  ', $div).str_repeat(' ', $mod);
256256
}
257257

258-
$div = floor($count / 2);
258+
$div = (int) floor($count / 2);
259259
$mod = $count % 2;
260260
return str_repeat('  ', $div).str_repeat(' ', $mod);
261261
}

lib/jblond/Diff/SequenceMatcher.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ class SequenceMatcher
7474
private $options = array();
7575

7676
/**
77-
* @var
77+
* @var null|array
7878
*/
7979
private $opCodes;
8080

8181
/**
82-
* @var
82+
* @var null|array
8383
*/
8484
private $matchingBlocks;
8585

8686
/**
87-
* @var
87+
* @var null|array
8888
*/
8989
private $fullBCount;
9090

@@ -105,7 +105,7 @@ class SequenceMatcher
105105
* @param string|array $a A string or array containing the lines to compare against.
106106
* @param string|array $b A string or array containing the lines to compare.
107107
* @param array $options
108-
* @param string|array $junkCallback Either an array or string that references a callback function (if there is one) to determine 'junk' characters.
108+
* @param string|array|null $junkCallback Either an array or string that references a callback function (if there is one) to determine 'junk' characters.
109109
*/
110110
public function __construct($a, $b, $options, $junkCallback=null)
111111
{
@@ -670,7 +670,7 @@ private function calculateRatio($matches, $length=0)
670670
* Essentially cleaner than doing a series of if(isset()) {} else {} calls.
671671
*
672672
* @param array $array The array to search.
673-
* @param string $key The key to check that exists.
673+
* @param string|int $key The key to check that exists.
674674
* @param mixed $default The value to return as the default value if the key doesn't exist.
675675
* @return mixed The value from the array if the key exists or otherwise the default.
676676
*/

0 commit comments

Comments
 (0)