From be2acf5185e358c50d1464a44a464bbe4e23f0df Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:29:03 +0200 Subject: [PATCH 1/6] Add explicit null type --- src/Entity/Task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Task.php b/src/Entity/Task.php index d6793f1..a7c20ce 100644 --- a/src/Entity/Task.php +++ b/src/Entity/Task.php @@ -52,7 +52,7 @@ public function getInterval() /** * {@inheritdoc} */ - public function setInterval(CronExpression $interval, \DateTimeImmutable $firstExecution = null, \DateTimeImmutable $lastExecution = null) + public function setInterval(CronExpression $interval, \DateTimeImmutable|null $firstExecution = null, \DateTimeImmutable|null $lastExecution = null) { parent::setInterval($interval, $firstExecution, $lastExecution); From 2fcd78d49cab6f851f07d60eafa0799243d8e2e7 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:31:30 +0200 Subject: [PATCH 2/6] Add null type --- src/EventListener/DoctrineTaskExecutionListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventListener/DoctrineTaskExecutionListener.php b/src/EventListener/DoctrineTaskExecutionListener.php index 8979876..d1a0114 100644 --- a/src/EventListener/DoctrineTaskExecutionListener.php +++ b/src/EventListener/DoctrineTaskExecutionListener.php @@ -27,7 +27,7 @@ class DoctrineTaskExecutionListener /** * @param EntityManagerInterface $entityManager */ - public function __construct(EntityManagerInterface $entityManager = null) + public function __construct(?EntityManagerInterface $entityManager = null) { $this->entityManager = $entityManager; } From 6bb218cdd9b141f5f0dc832868ab89a865a0c33b Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:32:30 +0200 Subject: [PATCH 3/6] Add null --- src/Entity/Task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Task.php b/src/Entity/Task.php index a7c20ce..292ba1a 100644 --- a/src/Entity/Task.php +++ b/src/Entity/Task.php @@ -52,7 +52,7 @@ public function getInterval() /** * {@inheritdoc} */ - public function setInterval(CronExpression $interval, \DateTimeImmutable|null $firstExecution = null, \DateTimeImmutable|null $lastExecution = null) + public function setInterval(CronExpression $interval, ?\DateTimeImmutable $firstExecution = null, ?\DateTimeImmutable $lastExecution = null) { parent::setInterval($interval, $firstExecution, $lastExecution); From 32020693fe77ac62ea9f743cbacd51dd4210be4f Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:33:32 +0200 Subject: [PATCH 4/6] Add null type --- src/Entity/TaskExecutionRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/TaskExecutionRepository.php b/src/Entity/TaskExecutionRepository.php index 7236008..430d154 100644 --- a/src/Entity/TaskExecutionRepository.php +++ b/src/Entity/TaskExecutionRepository.php @@ -129,7 +129,7 @@ public function findByTaskUuid($taskUuid) /** * {@inheritdoc} */ - public function findNextScheduled(\DateTimeImmutable $dateTime = null, array $skippedExecutions = []) + public function findNextScheduled(?\DateTimeImmutable $dateTime = null, array $skippedExecutions = []) { $queryBuilder = $this->createQueryBuilder('e') ->innerJoin('e.task', 't') From ec9869b26235880a5a28068ea2571ae69f76d551 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:34:19 +0200 Subject: [PATCH 5/6] Add null type --- tests/Functional/BaseCommandTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Functional/BaseCommandTestCase.php b/tests/Functional/BaseCommandTestCase.php index cf40ee8..ffc29d7 100644 --- a/tests/Functional/BaseCommandTestCase.php +++ b/tests/Functional/BaseCommandTestCase.php @@ -98,7 +98,7 @@ protected function setUp(): void * * @return TaskInterface */ - protected function createTask($workload, CronExpression $cronExpression = null, $handlerClass = TestHandler::class) + protected function createTask($workload, ?CronExpression $cronExpression = null, $handlerClass = TestHandler::class) { $task = $this->taskRepository->create($handlerClass, $workload); if ($cronExpression) { From 2b252f2d9db057b62ce32d502778f276df9fcd3d Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 20 Aug 2026 09:35:07 +0200 Subject: [PATCH 6/6] Add null types --- tests/Functional/Entity/TaskExecutionRepositoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Functional/Entity/TaskExecutionRepositoryTest.php b/tests/Functional/Entity/TaskExecutionRepositoryTest.php index b4012e8..32fccd4 100644 --- a/tests/Functional/Entity/TaskExecutionRepositoryTest.php +++ b/tests/Functional/Entity/TaskExecutionRepositoryTest.php @@ -187,7 +187,7 @@ public function testFindScheduledSkipped() * * @return TaskExecutionInterface */ - private function save(TaskInterface $task = null, \DateTimeImmutable $scheduleTime = null, $status = TaskStatus::PLANNED) + private function save(?TaskInterface $task = null, ?\DateTimeImmutable $scheduleTime = null, $status = TaskStatus::PLANNED) { if (!$scheduleTime) { $scheduleTime = new \DateTimeImmutable();