{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/bin\/code-scan.php"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/bin\/code-scan.php",
"content": "#!\/usr\/bin\/env php\n<?php\n\ndeclare(strict_types=1);\n\n\/\/ @responsibility: CLI-Einstiegspunkt für Code-Scan\n\nrequire_once __DIR__ . '\/..\/vendor\/autoload.php';\n\n$dotenv = Dotenv\\Dotenv::createImmutable(__DIR__ . '\/..');\n$dotenv->load();\n\nrequire_once __DIR__ . '\/..\/config\/config.php';\nrequire_once __DIR__ . '\/..\/config\/database.php';\nrequire_once __DIR__ . '\/..\/config\/autoload.php';\n\nuse Infrastructure\\CodeAnalysis\\CodeScanner;\n\n$options = getopt('', ['json', 'quiet', 'help']);\n$jsonOutput = isset($options['json']);\n$quiet = isset($options['quiet']);\n\nif (isset($options['help'])) {\n echo \"Code-Scan CLI\\n\";\n echo \"Usage: php code-scan.php [options]\\n\\n\";\n echo \"Options:\\n\";\n echo \" --json Output als JSON\\n\";\n echo \" --quiet Keine Ausgabe (nur Exit-Code)\\n\";\n echo \" --help Diese Hilfe anzeigen\\n\";\n exit(0);\n}\n\n$app = new Framework\\App();\n$container = $app->container();\n$scanner = $container->get(CodeScanner::class);\n\nif (!$quiet && !$jsonOutput) {\n echo \"=== Code-Scan: \" . date('Y-m-d H:i:s') . \" ===\\n\\n\";\n echo \"Scanne konfigurierte Verzeichnisse...\\n\";\n}\n\n$result = $scanner->scan(null, 'cli');\n\nif ($jsonOutput) {\n echo json_encode([\n 'success' => true,\n 'scan_id' => $result['scan_id'],\n 'files_scanned' => $result['files_scanned'],\n 'files_with_errors' => $result['files_with_errors'],\n 'total_classes' => $result['total_classes'],\n 'total_functions' => $result['total_functions'],\n 'duration_ms' => $result['duration_ms'],\n ], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . \"\\n\";\n} elseif (!$quiet) {\n echo \"\\n=== Scan abgeschlossen ===\\n\";\n echo \"Scan-ID: {$result['scan_id']}\\n\";\n echo \"Dateien: {$result['files_scanned']}\\n\";\n echo \"Fehler: {$result['files_with_errors']}\\n\";\n echo \"Klassen: {$result['total_classes']}\\n\";\n echo \"Funktionen: {$result['total_functions']}\\n\";\n echo \"Dauer: {$result['duration_ms']}ms\\n\";\n}\n\nexit($result['files_with_errors'] > 0 ? 1 : 0);\n",
"numLines": 65,
"startLine": 1,
"totalLines": 65
}
}
}