We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17807fb commit f760c05Copy full SHA for f760c05
1 file changed
src/NullableTypeSafeGetter.php
@@ -26,15 +26,15 @@ public function getBool(string $name):?bool {
26
public function getDateTime(string $name):?DateTimeInterface {
27
return $this->getNullableType(
28
$name,
29
- function(string|int|DateTimeInterface $value) {
+ function(string|int|float|DateTimeInterface $value) {
30
if($value instanceof DateTimeInterface) {
31
return $value;
32
}
33
34
if(is_numeric($value)) {
35
- $dt = new DateTimeImmutable();
36
- return $dt->setTimestamp($value);
+ return new DateTimeImmutable("@$value");
37
+
38
return new DateTimeImmutable($value);
39
40
);
0 commit comments