{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Config\/ConfigDTO.php",
"old_string": " public function toArray(): array\n {\n return [\n 'id' => $this->id,\n 'type' => $this->type,\n 'name' => $this->name,\n 'slug' => $this->slug,\n 'description' => $this->description,\n 'content' => $this->content,\n 'version' => $this->version,\n 'status' => $this->status,\n 'parent_id' => $this->parentId,\n 'parent_name' => $this->parentName,\n 'created_at' => $this->createdAt,\n 'updated_at' => $this->updatedAt,\n ];\n }",
"new_string": " public function toArray(): array\n {\n return [\n 'id' => $this->id,\n 'type' => $this->type,\n 'name' => $this->name,\n 'slug' => $this->slug,\n 'description' => $this->description,\n 'content' => $this->content,\n 'version' => $this->version,\n 'status' => $this->status,\n 'parent_id' => $this->parentId,\n 'prompt_id' => $this->promptId,\n 'sort_order' => $this->sortOrder,\n 'parent_name' => $this->parentName,\n 'created_at' => $this->createdAt,\n 'updated_at' => $this->updatedAt,\n ];\n }"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Config\/ConfigDTO.php",
"oldString": " public function toArray(): array\n {\n return [\n 'id' => $this->id,\n 'type' => $this->type,\n 'name' => $this->name,\n 'slug' => $this->slug,\n 'description' => $this->description,\n 'content' => $this->content,\n 'version' => $this->version,\n 'status' => $this->status,\n 'parent_id' => $this->parentId,\n 'parent_name' => $this->parentName,\n 'created_at' => $this->createdAt,\n 'updated_at' => $this->updatedAt,\n ];\n }",
"newString": " public function toArray(): array\n {\n return [\n 'id' => $this->id,\n 'type' => $this->type,\n 'name' => $this->name,\n 'slug' => $this->slug,\n 'description' => $this->description,\n 'content' => $this->content,\n 'version' => $this->version,\n 'status' => $this->status,\n 'parent_id' => $this->parentId,\n 'prompt_id' => $this->promptId,\n 'sort_order' => $this->sortOrder,\n 'parent_name' => $this->parentName,\n 'created_at' => $this->createdAt,\n 'updated_at' => $this->updatedAt,\n ];\n }",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\nnamespace UseCases\\Config;\n\n\/\/ @responsibility: Datenübertragungsobjekt für Content-Konfigurationen\n\nfinal class ConfigDTO\n{\n public function __construct(\n public readonly ?int $id,\n public readonly string $type,\n public readonly string $name,\n public readonly string $slug,\n public readonly ?string $description,\n public readonly string $content,\n public readonly string $version,\n public readonly string $status,\n public readonly ?int $parentId,\n public readonly ?int $promptId = null,\n public readonly int $sortOrder = 0,\n public readonly ?string $parentName = null,\n public readonly ?string $createdAt = null,\n public readonly ?string $updatedAt = null,\n ) {\n }\n\n public static function fromArray(array $data): self\n {\n return new self(\n id: isset($data['id']) ? (int) $data['id'] : null,\n type: $data['type'] ?? '',\n name: $data['name'] ?? '',\n slug: $data['slug'] ?? '',\n description: $data['description'] ?? null,\n content: $data['content'] ?? '{}',\n version: $data['version'] ?? '1.0',\n status: $data['status'] ?? 'draft',\n parentId: isset($data['parent_id']) ? (int) $data['parent_id'] : null,\n promptId: isset($data['prompt_id']) ? (int) $data['prompt_id'] : null,\n sortOrder: (int) ($data['sort_order'] ?? 0),\n parentName: $data['parent_name'] ?? null,\n createdAt: $data['created_at'] ?? null,\n updatedAt: $data['updated_at'] ?? null,\n );\n }\n\n public function getContentDecoded(): ?array\n {\n $decoded = json_decode($this->content, true);\n\n return is_array($decoded) ? $decoded : null;\n }\n\n public function toArray(): array\n {\n return [\n 'id' => $this->id,\n 'type' => $this->type,\n 'name' => $this->name,\n 'slug' => $this->slug,\n 'description' => $this->description,\n 'content' => $this->content,\n 'version' => $this->version,\n 'status' => $this->status,\n 'parent_id' => $this->parentId,\n 'parent_name' => $this->parentName,\n 'created_at' => $this->createdAt,\n 'updated_at' => $this->updatedAt,\n ];\n }\n}\n",
"structuredPatch": [
{
"oldStart": 65,
"oldLines": 6,
"newStart": 65,
"newLines": 8,
"lines": [
" 'version' => $this->version,",
" 'status' => $this->status,",
" 'parent_id' => $this->parentId,",
"+ 'prompt_id' => $this->promptId,",
"+ 'sort_order' => $this->sortOrder,",
" 'parent_name' => $this->parentName,",
" 'created_at' => $this->createdAt,",
" 'updated_at' => $this->updatedAt,"
]
}
],
"userModified": false,
"replaceAll": false
}
}