From 752312d736e0c8a6387e5c13b48c0ac9547540b1 Mon Sep 17 00:00:00 2001 From: Adrian Dumitrache Date: Fri, 19 Apr 2024 09:25:55 +0300 Subject: [PATCH] Resolved code review feedback --- packages/cron-job/Event/PreCronJobExecutionEvent.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/cron-job/Event/PreCronJobExecutionEvent.php b/packages/cron-job/Event/PreCronJobExecutionEvent.php index 5f00b83b..3371b09d 100644 --- a/packages/cron-job/Event/PreCronJobExecutionEvent.php +++ b/packages/cron-job/Event/PreCronJobExecutionEvent.php @@ -9,14 +9,13 @@ class PreCronJobExecutionEvent extends Event { - private ?string $command; + private string $command; public function __construct( private CronJobExecution $execution, private bool $executionCancelled = false, - ?string $command = null ) { - $this->command = $command ?? $this->execution->getCronJob()?->getCommand(); + $this->command = $this->execution->getCronJob()->getCommand(); } public function getExecution(): CronJobExecution @@ -36,12 +35,12 @@ public function setExecutionCancelled(bool $executionCancelled): self return $this; } - public function getCommand(): ?string + public function getCommand(): string { return $this->command; } - public function setCommand(?string $command): self + public function setCommand(string $command): self { $this->command = $command;