mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 06:40:33 -04:00
More type fixes
This commit is contained in:
parent
a5a19f947f
commit
99b5fd66f2
17 changed files with 103 additions and 122 deletions
|
@ -317,12 +317,7 @@ class HttpInput{
|
|||
case Enums\HttpVariableType::Integer:
|
||||
// Can't use `ctype_digit()` because we may want negative integers.
|
||||
if(is_numeric($var) && mb_strpos((string)$var, '.') === false){
|
||||
try{
|
||||
return intval($var);
|
||||
}
|
||||
catch(Exception){
|
||||
return null;
|
||||
}
|
||||
return intval($var);
|
||||
}
|
||||
break;
|
||||
case Enums\HttpVariableType::Boolean:
|
||||
|
@ -334,12 +329,7 @@ class HttpInput{
|
|||
}
|
||||
case Enums\HttpVariableType::Decimal:
|
||||
if(is_numeric($var)){
|
||||
try{
|
||||
return floatval($var);
|
||||
}
|
||||
catch(Exception){
|
||||
return null;
|
||||
}
|
||||
return floatval($var);
|
||||
}
|
||||
break;
|
||||
case Enums\HttpVariableType::DateTime:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue