diff --git a/src/Dump.php b/src/Dump.php index caabd07..9271e12 100644 --- a/src/Dump.php +++ b/src/Dump.php @@ -14,7 +14,7 @@ namespace Negundo\Client { protected Util\DumpHandler $dumpHandler; - public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, Transport\TransportInterface $transport = null) + public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, ? Transport\TransportInterface $transport = null) { $this->config = $config; $this->transport = $transport ?: new Transport\Curl(); diff --git a/src/Task.php b/src/Task.php index abd5759..abb8c47 100644 --- a/src/Task.php +++ b/src/Task.php @@ -14,7 +14,7 @@ namespace Negundo\Client { protected SoftwareConfig $config; - public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, Transport\TransportInterface $transport = null) + public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, ? Transport\TransportInterface $transport = null) { $this->config = $config; @@ -30,13 +30,13 @@ namespace Negundo\Client { $report = $this->taskHandler->sendReport($message, $title, $data, $events); // Make sure not to spam the server if an ErrorMessage or Exception was already sent (like inside a loop) - $dumpHash = $this->taskHandler->hash($report); + $taskHash = $this->taskHandler->hash($report); - if ( $this->sent[$dumpHash] ?? false ) { + if ( $this->sent[$taskHash] ?? false ) { return null; } - $this->sent[$dumpHash] = true; + $this->sent[$taskHash] = true; return $this->transport->push($this->config->url('task/report'), $report); } diff --git a/src/Task/StatusEnum.php b/src/Task/StatusEnum.php index b1d0351..97d4973 100644 --- a/src/Task/StatusEnum.php +++ b/src/Task/StatusEnum.php @@ -4,6 +4,7 @@ namespace Negundo\Client\Task; enum StatusEnum : string { + case New = "new"; case Failed = "failed"; case Warning = "warning"; case Completed = "completed";