diff --git a/src/Support/Mapping/Casts/ConstNumberCast.php b/src/Support/Mapping/Casts/ConstNumberCast.php index 74dcb5d..e9b8f0a 100644 --- a/src/Support/Mapping/Casts/ConstNumberCast.php +++ b/src/Support/Mapping/Casts/ConstNumberCast.php @@ -9,10 +9,20 @@ class ConstNumberCast extends ConstCast { + protected bool $asAnyNumber = false; + public function __construct( protected readonly int|float $value, - protected readonly bool $asAnyNumber + bool $asAnyNumber ) { + $this->asAnyNumber = $asAnyNumber; + } + + public function asAnyNumber(): static + { + $this->asAnyNumber = true; + + return $this; } public function originalValue(): int|float