CastToDate
in package
implements
TypeCasting
FinalYes
Tags
Table of Contents
Interfaces
Properties
- $class : class-string
- $default : DateTimeImmutable|DateTime|null
- $format : string|null
- $info : TypeCastingInfo
- $isNullable : bool
- $timezone : DateTimeZone|null
- $type : Type
Methods
- __construct() : mixed
- info() : TypeCastingInfo
- setOptions() : void
- Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.
- toVariable() : TValue
- cast() : DateTimeImmutable|DateTime
- init() : DateTimeInterface>, 2: bool}
Properties
$class
private
class-string
$class
$default
private
DateTimeImmutable|DateTime|null
$default
= null
$format
private
string|null
$format
= null
$info read-only
private
TypeCastingInfo
$info
$isNullable read-only
private
bool
$isNullable
$timezone
private
DateTimeZone|null
$timezone
= null
$type read-only
private
Type
$type
Methods
__construct()
public
__construct(ReflectionProperty|ReflectionParameter $reflectionProperty) : mixed
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter
Tags
info()
public
info() : TypeCastingInfo
Return values
TypeCastingInfosetOptions()
Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.
public
setOptions([string|null $default = null ][, string|null $format = null ][, DateTimeZone|string|null $timezone = null ][, class-string|null $className = null ]) : void
Parameters
- $default : string|null = null
- $format : string|null = null
- $timezone : DateTimeZone|string|null = null
- $className : class-string|null = null
Tags
toVariable()
public
toVariable(mixed $value) : TValue
Parameters
- $value : mixed
Tags
Return values
TValuecast()
private
cast(mixed $value) : DateTimeImmutable|DateTime
Parameters
- $value : mixed
Tags
Return values
DateTimeImmutable|DateTimeinit()
private
init(ReflectionProperty|ReflectionParameter $reflectionProperty) : DateTimeInterface>, 2: bool}
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter