- Minors fixes

This commit is contained in:
Dave M. 2025-07-17 18:36:38 +00:00
parent 8de8aafa84
commit f1e9dddf5e
3 changed files with 6 additions and 5 deletions

View File

@ -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();

View File

@ -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);
}

View File

@ -4,6 +4,7 @@ namespace Negundo\Client\Task;
enum StatusEnum : string
{
case New = "new";
case Failed = "failed";
case Warning = "warning";
case Completed = "completed";