Add ModelReflection Service as dependency injection + tests

This commit is contained in:
Eric Espie
2025-11-19 14:42:32 +01:00
parent 6678689b77
commit 65bd6d9fd0
18 changed files with 285 additions and 44 deletions

View File

@@ -2,18 +2,27 @@
namespace Combodo\iTop\Forms\IO\Format;
class NumberIOFormat
class NumberIOFormat extends AbstractIOFormat
{
public mixed $oValue;
public function __construct(string $oValue)
{
$this->oValue = $oValue;
// validation du format sinon exception
}
public function __toString(): string
{
return $this->oValue;
return strval($this->oValue);
}
public function jsonSerialize(): mixed
{
return strval($this->oValue);
}
public static function IsCompatible(string $sOtherFormatClass): bool
{
return is_a($sOtherFormatClass, NumberIOFormat::class, true) || is_a($sOtherFormatClass, RawFormat::class, true);
}
}