ValueCaster
class ValueCaster
Methods
static mixed
castBuiltin(string $type, mixed $value)
Cast one value to a built-in type.
static BackedEnum|Uncastable
static Uncastable|DateTimeInterface
castDate(string|null $type, mixed $value, CreationContext $context, string|array|null $format = null, string|null $setTimeZone = null, string|null $timeZone = null)
Cast one value to a declared date type.
static bool
castBoolean(mixed $value)
Cast one value to a boolean.
static DateTime|DateTimeImmutable|null
createDate(string $type, string $format, string $value, DateTimeZone|null $timeZone)
Create a date using the declared concrete type or Hypervel's date factory.
Details
at line 28
static mixed
castBuiltin(string $type, mixed $value)
Cast one value to a built-in type.
at line 44
static BackedEnum|Uncastable
castEnum(string|null $type, mixed $value, DataProperty $property)
Cast one value to a backed enum.
at line 74
static Uncastable|DateTimeInterface
castDate(string|null $type, mixed $value, CreationContext $context, string|array|null $format = null, string|null $setTimeZone = null, string|null $timeZone = null)
Cast one value to a declared date type.
at line 125
static protected bool
castBoolean(mixed $value)
Cast one value to a boolean.
at line 143
static protected DateTime|DateTimeImmutable|null
createDate(string $type, string $format, string $value, DateTimeZone|null $timeZone)
Create a date using the declared concrete type or Hypervel's date factory.