- WIP on TaskReport

This commit is contained in:
Dave Mc Nicoll 2024-11-08 09:14:56 -05:00
parent 6227321045
commit 7b5a1bcf97
2 changed files with 7 additions and 3 deletions

View File

@ -45,6 +45,7 @@ namespace Negundo\Client {
namespace {
use Negundo\Client\Task\StatusEnum;
use Negundo\Client\Task\TaskReport;
if (! function_exists('ntask') ) {
@ -58,8 +59,11 @@ namespace {
}
}
function nreport(TaskReport $report) {
function nreport(TaskReport $report)
{
if ($report->status !== StatusEnum::NothingToDo || $report->getEvents()) {
ntask($report->getMessage(), $report->getTitle(), $report->getData(), $report->getStatus(), $report->getEvents());
}
}
}
}

View File

@ -20,7 +20,7 @@ class TaskReport
return $this;
}
public function addEvent(string $key, ? StatusEnum $status = null, array $data) : static
public function addEvent(string $key, ? StatusEnum $status = null, array $data = []) : static
{
$this->events[] = [
'key' => $key,