Backup #2113
| ID | 2113 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/UseCases/Protokoll/ProtokollDTO.php |
| Version | 4 |
| Typ |
modified |
| Größe | 2.5 KB |
| Hash | 3f4916226ed41711d04419d6d9bd942a4919e41850811581217a21d008c375d3 |
| Datum | 2025-12-29 09:03:47 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
declare(strict_types=1);
namespace UseCases\Protokoll;
// @responsibility: Datenübertragungsobjekt für KI-Protokoll-Einträge
final class ProtokollDTO
{
public function __construct(
public readonly int $id,
public readonly ?string $timestamp,
public readonly ?string $clientName,
public readonly ?string $modelName,
public readonly ?string $request,
public readonly ?string $response,
public readonly ?string $status,
public readonly ?int $tokensTotal,
public readonly ?int $durationMs,
public readonly ?string $requestPreview = null,
public readonly ?string $requestFormatted = null,
public readonly ?string $responseFormatted = null,
public readonly ?string $requestIp = null,
public readonly ?string $requestTimestamp = null,
public readonly ?string $responseTimestamp = null,
public readonly ?int $tokensInput = null,
public readonly ?int $tokensOutput = null,
public readonly ?string $errorMessage = null,
) {
}
public static function fromArray(array $data): self
{
return new self(
id: (int) $data['id'],
timestamp: $data['timestamp'] ?? null,
clientName: $data['client_name'] ?? null,
modelName: $data['model_name'] ?? null,
request: $data['request'] ?? null,
response: $data['response'] ?? null,
status: $data['status'] ?? null,
tokensTotal: isset($data['tokens_total']) ? (int) $data['tokens_total'] : null,
durationMs: isset($data['duration_ms']) ? (int) $data['duration_ms'] : null,
requestPreview: $data['request_preview'] ?? null,
requestFormatted: $data['request_formatted'] ?? null,
responseFormatted: $data['response_formatted'] ?? null,
);
}
public function toArray(): array
{
return [
'id' => $this->id,
'timestamp' => $this->timestamp,
'client_name' => $this->clientName,
'model_name' => $this->modelName,
'request' => $this->request,
'response' => $this->response,
'status' => $this->status,
'tokens_total' => $this->tokensTotal,
'duration_ms' => $this->durationMs,
'request_preview' => $this->requestPreview,
'request_formatted' => $this->requestFormatted,
'response_formatted' => $this->responseFormatted,
];
}
}
Vollständig herunterladen
Aktionen
Andere Versionen dieser Datei
| ID |
Version |
Typ |
Größe |
Datum |
| 2114 |
5 |
modified |
2.9 KB |
2025-12-29 09:04 |
| 2113 |
4 |
modified |
2.5 KB |
2025-12-29 09:03 |
| 2112 |
3 |
modified |
2.2 KB |
2025-12-29 09:03 |
| 725 |
2 |
modified |
2.1 KB |
2025-12-23 07:56 |
| 467 |
1 |
modified |
1.7 KB |
2025-12-22 10:31 |
← Zurück zur Übersicht