Fixes for PHP 8.3

This commit is contained in:
slawkens
2024-01-27 17:27:05 +01:00
parent 76256a7ee6
commit 6d23b285c1
2 changed files with 7 additions and 2 deletions

View File

@@ -201,7 +201,7 @@ function getFlagImage($country): string
* @param mixed $v Variable to check.
* @return bool Value boolean status.
*/
function getBoolean($v): bool
function getBoolean(mixed $v): bool
{
if(is_bool($v)) {
return $v;
@@ -210,6 +210,10 @@ function getBoolean($v): bool
if(is_numeric($v))
return (int)$v > 0;
if (is_null($v)) {
return false;
}
$v = strtolower($v);
return $v === 'yes' || $v === 'true';
}