Skip to content

Commit 696da61

Browse files
committed
Fix datetime options to allow provide \DateTimeInterface instances
1 parent 570dda2 commit 696da61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Resolver/NotificationResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ public function resolve(array $data)
149149
})
150150
->setDefined('send_after')
151151
->setAllowedTypes('send_after', '\DateTimeInterface')
152-
->setNormalizer('send_after', function (Options $options, \DateTime $value) {
152+
->setNormalizer('send_after', function (Options $options, \DateTimeInterface $value) {
153153
return $this->normalizeDateTime($options, $value, self::SEND_AFTER_FORMAT);
154154
})
155155
->setDefined('delayed_option')
156156
->setAllowedTypes('delayed_option', 'string')
157157
->setAllowedValues('delayed_option', ['timezone', 'last-active'])
158158
->setDefined('delivery_time_of_day')
159159
->setAllowedTypes('delivery_time_of_day', '\DateTimeInterface')
160-
->setNormalizer('delivery_time_of_day', function (Options $options, \DateTime $value) {
160+
->setNormalizer('delivery_time_of_day', function (Options $options, \DateTimeInterface $value) {
161161
return $this->normalizeDateTime($options, $value, self::DELIVERY_TIME_OF_DAY_FORMAT);
162162
})
163163
->setDefined('android_led_color')
@@ -278,7 +278,7 @@ private function filterWebButtons($buttons)
278278
return true;
279279
}
280280

281-
private function normalizeDateTime(Options $options, \DateTime $value, $format)
281+
private function normalizeDateTime(Options $options, \DateTimeInterface $value, $format)
282282
{
283283
return $value->format($format);
284284
}

0 commit comments

Comments
 (0)