Skip to content

Commit 94be0cc

Browse files
committed
Add date interval to type factory
1 parent 00754ac commit 94be0cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

TypeFactory.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ private function getClassType(?string $className, string $format = 'json', ?bool
8787
'format' => 'date-time',
8888
];
8989
}
90+
if (is_a($className, \DateInterval::class, true)) {
91+
return [
92+
'type' => 'string',
93+
'format' => 'duration',
94+
];
95+
}
9096
if (is_a($className, UuidInterface::class, true)) {
9197
return [
9298
'type' => 'string',

0 commit comments

Comments
 (0)