From 4f4f4662a59e9b0f370cbb670dba700cfd83270e Mon Sep 17 00:00:00 2001 From: czachor Date: Thu, 9 Jan 2025 11:33:00 +0100 Subject: [PATCH] Fixes wrong datetime type usage Fixes: Could not convert PHP value of type Symfony\Component\Clock\DatePoint to type Doctrine\DBAL\Types\DateTimeType. Expected one of the following types: null, DateTime. Same as: https://github.com/shapecode/cron-bundle/pull/66/files --- src/Command/CronProcessCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command/CronProcessCommand.php b/src/Command/CronProcessCommand.php index 520fe5a..b6b67b7 100644 --- a/src/Command/CronProcessCommand.php +++ b/src/Command/CronProcessCommand.php @@ -4,6 +4,7 @@ namespace Shapecode\Bundle\CronBundle\Command; +use DateTime; use Doctrine\ORM\EntityManagerInterface; use Psr\Clock\ClockInterface; use RuntimeException; @@ -136,7 +137,7 @@ private function recordJobResult( $timeTaken, $statusCode, $buffer, - $this->clock->now(), + DateTime::createFromImmutable($this->clock->now()), ); $this->entityManager->persist($result);