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';
}

View File

@ -41,9 +41,10 @@
class OTS_Monster extends DOMDocument
{
private $loaded = false;
public function loadXML($source , $options = 0)
public function loadXML(string $source , int $options = 0): bool
{
$this->loaded = parent::loadXML($source, $options);
return $this->loaded;
}
public function loaded()