Skip to content

Commit

Permalink
Psalm isn't clever enough to keep up with our hacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Sep 27, 2017
1 parent c332dbd commit a2a8e87
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/cast_to_int.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
* through.
*
* @param int|float $number The number we want to convert to an int
* @param boolean $fail_open Set to true to not throw an exception
* @param bool $fail_open Set to true to not throw an exception
*
* @return float|int
* @psalm-suppress InvalidReturnType
*
* @throws TypeError
*/
Expand Down Expand Up @@ -69,11 +70,6 @@ function RandomCompat_intval($number, $fail_open = false)
'Expected an integer.'
);
}
if (is_float($number)) {
return $number;
}
throw new TypeError(
'Expected a numeric value.'
);
return $number;
}
}

0 comments on commit a2a8e87

Please sign in to comment.