jb-data.de/lib/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php
2025-08-11 22:23:30 +02:00

21 lines
429 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use Stringable;
class BaseParserClass
{
protected static function boolean(mixed $value): bool
{
if (is_object($value)) {
$value = ($value instanceof Stringable) ? ((string) $value) : 'true';
}
if (is_numeric($value)) {
return (bool) $value;
}
return $value === 'true' || $value === 'TRUE';
}
}