diff --git a/src/Entity/Task.php b/src/Entity/Task.php index d6793f1..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 $firstExecution = null, \DateTimeImmutable $lastExecution = null) + public function setInterval(CronExpression $interval, ?\DateTimeImmutable $firstExecution = null, ?\DateTimeImmutable $lastExecution = null) { parent::setInterval($interval, $firstExecution, $lastExecution); 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') 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; } 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) { 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();