fix typing of Datetime

This commit is contained in:
Julien Fastré 2024-12-06 12:17:46 +01:00
parent f5c1b5cf8a
commit 633bb00154
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -18,8 +18,6 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\Service\ShortMessageNotification; namespace Chill\CalendarBundle\Service\ShortMessageNotification;
use Monolog\DateTimeImmutable;
/** /**
* * Lundi => Envoi des rdv du mardi et mercredi. * * Lundi => Envoi des rdv du mardi et mercredi.
* * Mardi => Envoi des rdv du jeudi. * * Mardi => Envoi des rdv du jeudi.
@ -31,7 +29,7 @@ class DefaultRangeGenerator implements RangeGeneratorInterface
{ {
public function generateRange(\DateTimeImmutable $date): ?array public function generateRange(\DateTimeImmutable $date): ?array
{ {
$onMidnight = DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $date->format('Y-m-d').' 00:00:00'); $onMidnight = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $date->format('Y-m-d').' 00:00:00');
switch ($dow = (int) $onMidnight->format('w')) { switch ($dow = (int) $onMidnight->format('w')) {
case 6: // Saturday case 6: // Saturday