1 Commits
Author SHA1 Message Date
Dave Mc Nicoll 7b5a1bcf97 - WIP on TaskReport 2024-11-08 09:14:56 -05:00
2 changed files with 6 additions and 2 deletions

No files matched your search

+5 -1
View File
@@ -45,6 +45,7 @@ namespace Negundo\Client {
namespace { namespace {
use Negundo\Client\Task\StatusEnum;
use Negundo\Client\Task\TaskReport; use Negundo\Client\Task\TaskReport;
if (! function_exists('ntask') ) { 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()); ntask($report->getMessage(), $report->getTitle(), $report->getData(), $report->getStatus(), $report->getEvents());
} }
} }
} }
}
+1 -1
View File
@@ -20,7 +20,7 @@ class TaskReport
return $this; 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[] = [ $this->events[] = [
'key' => $key, 'key' => $key,