Skip to content

Commit 6595e84

Browse files
committed
Allow serializing DateTime objects (partial impl from #339)
1 parent e266f08 commit 6595e84

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/QueryReflection/QuerySimulation.php

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public static function simulateParamValueType(Type $paramType, bool $preparedPar
7373
return null;
7474
}
7575

76+
if ($paramType instanceof ObjectType && $paramType->isInstanceOf(\DateTimeInterface::class)) {
77+
return date(self::DATE_FORMAT, 0);
78+
}
79+
7680
$stringType = new StringType();
7781
$isStringableObjectType = $paramType instanceof ObjectType
7882
&& $paramType->isInstanceOf(Stringable::class)->yes();

0 commit comments

Comments
 (0)