{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/DTO\/CritiqueDTO.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\DTO;\n\n\/\/ @responsibility: DTO für Content-Kritik-Daten aus Repository\n\nfinal readonly class CritiqueDTO\n{\n public function __construct(\n public int $id,\n public int $versionId,\n public int $criticId,\n public string $criticName,\n public string $feedback,\n public ?int $score,\n public string $model,\n public int $tokensInput,\n public int $tokensOutput,\n public float $costUsd,\n public int $durationMs,\n public \\DateTimeImmutable $createdAt,\n ) {}\n\n \/**\n * Create from database row.\n *\n * @param array<string, mixed> $row\n *\/\n public static function fromDatabaseRow(array $row): self\n {\n return new self(\n id: (int) $row['id'],\n versionId: (int) $row['version_id'],\n criticId: (int) $row['critic_id'],\n criticName: (string) ($row['critic_name'] ?? 'Unbekannt'),\n feedback: (string) $row['feedback'],\n score: isset($row['score']) ? (int) $row['score'] : null,\n model: (string) ($row['model'] ?? 'unknown'),\n tokensInput: (int) ($row['tokens_input'] ?? 0),\n tokensOutput: (int) ($row['tokens_output'] ?? 0),\n costUsd: (float) ($row['cost_usd'] ?? 0.0),\n durationMs: (int) ($row['duration_ms'] ?? 0),\n createdAt: new \\DateTimeImmutable($row['created_at'] ?? 'now'),\n );\n }\n\n \/**\n * Check if critique has a score.\n *\/\n public function hasScore(): bool\n {\n return $this->score !== null;\n }\n\n \/**\n * Get score as percentage (0-100).\n *\/\n public function scorePercentage(): ?int\n {\n return $this->score;\n }\n\n \/**\n * Get feedback preview.\n *\/\n public function feedbackPreview(int $length = 150): string\n {\n if (mb_strlen($this->feedback) <= $length) {\n return $this->feedback;\n }\n\n return mb_substr($this->feedback, 0, $length) . '...';\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/DTO\/CritiqueDTO.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\DTO;\n\n\/\/ @responsibility: DTO für Content-Kritik-Daten aus Repository\n\nfinal readonly class CritiqueDTO\n{\n public function __construct(\n public int $id,\n public int $versionId,\n public int $criticId,\n public string $criticName,\n public string $feedback,\n public ?int $score,\n public string $model,\n public int $tokensInput,\n public int $tokensOutput,\n public float $costUsd,\n public int $durationMs,\n public \\DateTimeImmutable $createdAt,\n ) {}\n\n \/**\n * Create from database row.\n *\n * @param array<string, mixed> $row\n *\/\n public static function fromDatabaseRow(array $row): self\n {\n return new self(\n id: (int) $row['id'],\n versionId: (int) $row['version_id'],\n criticId: (int) $row['critic_id'],\n criticName: (string) ($row['critic_name'] ?? 'Unbekannt'),\n feedback: (string) $row['feedback'],\n score: isset($row['score']) ? (int) $row['score'] : null,\n model: (string) ($row['model'] ?? 'unknown'),\n tokensInput: (int) ($row['tokens_input'] ?? 0),\n tokensOutput: (int) ($row['tokens_output'] ?? 0),\n costUsd: (float) ($row['cost_usd'] ?? 0.0),\n durationMs: (int) ($row['duration_ms'] ?? 0),\n createdAt: new \\DateTimeImmutable($row['created_at'] ?? 'now'),\n );\n }\n\n \/**\n * Check if critique has a score.\n *\/\n public function hasScore(): bool\n {\n return $this->score !== null;\n }\n\n \/**\n * Get score as percentage (0-100).\n *\/\n public function scorePercentage(): ?int\n {\n return $this->score;\n }\n\n \/**\n * Get feedback preview.\n *\/\n public function feedbackPreview(int $length = 150): string\n {\n if (mb_strlen($this->feedback) <= $length) {\n return $this->feedback;\n }\n\n return mb_substr($this->feedback, 0, $length) . '...';\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}