{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/ChatSessionDTO.php",
"old_string": "<?php\n\nnamespace UseCases\\Chat;\n\n\/**\n * ChatSessionDTO - Data Transfer Object for chat sessions\n *\n * Contains session data with messages for view rendering.\n *\/\nfinal class ChatSessionDTO",
"new_string": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Chat;\n\n\/\/ @responsibility: Datenübertragungsobjekt für Chat-Sessions\n\nfinal class ChatSessionDTO"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Chat\/ChatSessionDTO.php",
"oldString": "<?php\n\nnamespace UseCases\\Chat;\n\n\/**\n * ChatSessionDTO - Data Transfer Object for chat sessions\n *\n * Contains session data with messages for view rendering.\n *\/\nfinal class ChatSessionDTO",
"newString": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Chat;\n\n\/\/ @responsibility: Datenübertragungsobjekt für Chat-Sessions\n\nfinal class ChatSessionDTO",
"originalFile": "<?php\n\nnamespace UseCases\\Chat;\n\n\/**\n * ChatSessionDTO - Data Transfer Object for chat sessions\n *\n * Contains session data with messages for view rendering.\n *\/\nfinal class ChatSessionDTO\n{\n \/**\n * @param array<string,mixed> $session Session data from database\n * @param array<int,array<string,mixed>> $messages Messages for this session\n *\/\n public function __construct(\n private array $session,\n private array $messages = [],\n ) {\n }\n\n public function getId(): int\n {\n return (int) ($this->session['id'] ?? 0);\n }\n\n public function getUuid(): string\n {\n return $this->session['uuid'] ?? '';\n }\n\n public function getTitle(): ?string\n {\n return $this->session['title'] ?? null;\n }\n\n public function getModel(): string\n {\n return $this->session['model'] ?? 'claude-opus-4-5-20251101';\n }\n\n \/**\n * @return array<string>\n *\/\n public function getCollections(): array\n {\n $collections = $this->session['collections'] ?? '[\"documents\"]';\n $decoded = json_decode($collections, true);\n\n return is_array($decoded) ? $decoded : ['documents'];\n }\n\n public function getContextLimit(): int\n {\n return (int) ($this->session['context_limit'] ?? 5);\n }\n\n public function getAuthorProfileId(): int\n {\n return (int) ($this->session['author_profile_id'] ?? 0);\n }\n\n public function getSystemPromptId(): int\n {\n return (int) ($this->session['system_prompt_id'] ?? 1);\n }\n\n public function getTemperature(): float\n {\n return (float) ($this->session['temperature'] ?? 0.7);\n }\n\n public function getMaxTokens(): int\n {\n return (int) ($this->session['max_tokens'] ?? 4096);\n }\n\n public function getSystemPrompt(): ?string\n {\n return $this->session['system_prompt'] ?? null;\n }\n\n \/**\n * @return array<int,array<string,mixed>>\n *\/\n public function getMessages(): array\n {\n return $this->messages;\n }\n\n public function getMessageCount(): int\n {\n return count($this->messages);\n }\n\n \/**\n * Get raw session array for backwards compatibility\n *\n * @return array<string,mixed>\n *\/\n public function toArray(): array\n {\n return $this->session;\n }\n\n \/**\n * Check if session exists\n *\/\n public function exists(): bool\n {\n return $this->getId() > 0;\n }\n}\n",
"structuredPatch": [
{
"oldStart": 1,
"oldLines": 12,
"newStart": 1,
"newLines": 11,
"lines": [
" <?php",
" ",
"+declare(strict_types=1);",
"+",
" namespace UseCases\\Chat;",
" ",
"-\/**",
"- * ChatSessionDTO - Data Transfer Object for chat sessions",
"- *",
"- * Contains session data with messages for view rendering.",
"- *\/",
"+\/\/ @responsibility: Datenübertragungsobjekt für Chat-Sessions",
"+",
" final class ChatSessionDTO",
" {",
" \/**"
]
}
],
"userModified": false,
"replaceAll": false
}
}