{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/CodeAnalysis\/PhpFileParser.php",
"offset": 670,
"limit": 100
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/CodeAnalysis\/PhpFileParser.php",
"content": " * Extract a type name starting from a position.\n *\n * @param array<mixed> $tokens\n *\/\n private function extractTypeName(array $tokens, int $startIndex): ?string\n {\n $count = count($tokens);\n\n for ($i = $startIndex; $i < $count; $i++) {\n $token = $tokens[$i];\n\n if (!is_array($token)) {\n continue;\n }\n\n if ($token[0] === T_WHITESPACE) {\n continue;\n }\n\n if (in_array($token[0], [T_STRING, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED], true)) {\n return $token[1];\n }\n\n \/\/ Stop at unexpected token\n break;\n }\n\n return null;\n }\n\n \/**\n * Find next T_STRING token and return its value.\n *\n * @param array<mixed> $tokens\n *\/\n private function findNextString(array $tokens, int $startIndex): ?string\n {\n $count = count($tokens);\n\n for ($i = $startIndex + 1; $i < $count; $i++) {\n if (!is_array($tokens[$i])) {\n if ($tokens[$i] === '(') {\n return null; \/\/ Anonymous function\n }\n\n continue;\n }\n\n if ($tokens[$i][0] === T_STRING) {\n return $tokens[$i][1];\n }\n\n if ($tokens[$i][0] !== T_WHITESPACE) {\n break;\n }\n }\n\n return null;\n }\n\n \/**\n * @param array<mixed> $tokens\n *\/\n private function findPrevNonWhitespace(array $tokens, int $index): ?int\n {\n for ($i = $index - 1; $i >= 0; $i--) {\n if (!is_array($tokens[$i]) || $tokens[$i][0] !== T_WHITESPACE) {\n return $i;\n }\n }\n\n return null;\n }\n\n \/**\n * @param array<mixed> $tokens\n *\/\n private function findNextNonWhitespace(array $tokens, int $index): ?int\n {\n $count = count($tokens);\n\n for ($i = $index + 1; $i < $count; $i++) {\n if (!is_array($tokens[$i]) || $tokens[$i][0] !== T_WHITESPACE) {\n return $i;\n }\n }\n\n return null;\n }\n}\n",
"numLines": 91,
"startLine": 670,
"totalLines": 760
}
}
}