summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParagon Initiative Enterprises <security@paragonie.com>2017-03-03 15:35:22 -0500
committerParagon Initiative Enterprises <security@paragonie.com>2017-03-03 15:35:22 -0500
commitae8d9579494c22cb0fecb7f8c3e2a43724220810 (patch)
tree0b8cd7bd57386457039799bc557c8cc0e95a4690
parent748221e7a0c62e8b5613e4ec7571e245cb539c55 (diff)
downloadrandom_compat-ae8d9579494c22cb0fecb7f8c3e2a43724220810.zip
random_compat-ae8d9579494c22cb0fecb7f8c3e2a43724220810.tar.gz
random_compat-ae8d9579494c22cb0fecb7f8c3e2a43724220810.tar.bz2
Make psalm happy without breaking BC.
-rw-r--r--lib/cast_to_int.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cast_to_int.php b/lib/cast_to_int.php
index fea1612..138a025 100644
--- a/lib/cast_to_int.php
+++ b/lib/cast_to_int.php
@@ -48,6 +48,8 @@ if (!is_callable('RandomCompat_intval')) {
{
if (is_int($number) || is_float($number)) {
$number += 0;
+ } elseif (is_numeric($number)) {
+ $number = (int) $number;
}
if (