{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Traits\/JsonDecodeTrait.php"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Traits\/JsonDecodeTrait.php",
"content": "<?php\n\nnamespace Infrastructure\\Traits;\n\n\/**\n * Trait for safe JSON decoding with default empty array.\n * Use in non-Controller classes that need JSON parsing.\n *\/\ntrait JsonDecodeTrait\n{\n \/**\n * Decode JSON string to array with safe defaults.\n *\n * @return array<mixed>\n *\/\n protected function decodeJsonArray(?string $json): array\n {\n if ($json === null || $json === '') {\n return [];\n }\n\n $decoded = json_decode($json, true);\n\n return is_array($decoded) ? $decoded : [];\n }\n}\n",
"numLines": 27,
"startLine": 1,
"totalLines": 27
}
}
}