{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Config\/CredentialService.php",
"old_string": " \/**\n * Gets the MariaDB root password.\n *\/\n public static function getMariaDbPassword(): string\n {\n return self::getRequired('MARIADB_ROOT_PASSWORD');\n }\n\n \/**\n * Gets the Anthropic API key.\n *\/\n public static function getAnthropicApiKey(): string\n {\n return self::getRequired('ANTHROPIC_API_KEY');\n }\n\n \/**\n * Gets the Ollama host URL.\n *\/\n public static function getOllamaHost(): string\n {\n return self::get('OLLAMA_HOST', 'http:\/\/localhost:11434');\n }\n\n \/**\n * Gets the Qdrant host URL.\n *\/\n public static function getQdrantHost(): string\n {\n return self::get('QDRANT_HOST', 'http:\/\/localhost:6333');\n }",
"new_string": " \/**\n * Gets the MariaDB host.\n *\/\n public static function getMariaDbHost(): string\n {\n return self::get('MARIADB_HOST', 'localhost');\n }\n\n \/**\n * Gets the MariaDB user.\n *\/\n public static function getMariaDbUser(): string\n {\n return self::get('MARIADB_USER', 'root');\n }\n\n \/**\n * Gets the MariaDB root password.\n *\/\n public static function getMariaDbPassword(): string\n {\n return self::getRequired('MARIADB_ROOT_PASSWORD');\n }\n\n \/**\n * Gets the Anthropic API key.\n *\/\n public static function getAnthropicApiKey(): string\n {\n return self::getRequired('ANTHROPIC_API_KEY');\n }\n\n \/**\n * Gets the Ollama host URL.\n *\/\n public static function getOllamaHost(): string\n {\n return self::get('OLLAMA_HOST', 'http:\/\/localhost:11434');\n }\n\n \/**\n * Gets the Qdrant host URL.\n *\/\n public static function getQdrantHost(): string\n {\n return self::get('QDRANT_HOST', 'http:\/\/localhost:6333');\n }"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Infrastructure\/Config\/CredentialService.php",
"oldString": " \/**\n * Gets the MariaDB root password.\n *\/\n public static function getMariaDbPassword(): string\n {\n return self::getRequired('MARIADB_ROOT_PASSWORD');\n }\n\n \/**\n * Gets the Anthropic API key.\n *\/\n public static function getAnthropicApiKey(): string\n {\n return self::getRequired('ANTHROPIC_API_KEY');\n }\n\n \/**\n * Gets the Ollama host URL.\n *\/\n public static function getOllamaHost(): string\n {\n return self::get('OLLAMA_HOST', 'http:\/\/localhost:11434');\n }\n\n \/**\n * Gets the Qdrant host URL.\n *\/\n public static function getQdrantHost(): string\n {\n return self::get('QDRANT_HOST', 'http:\/\/localhost:6333');\n }",
"newString": " \/**\n * Gets the MariaDB host.\n *\/\n public static function getMariaDbHost(): string\n {\n return self::get('MARIADB_HOST', 'localhost');\n }\n\n \/**\n * Gets the MariaDB user.\n *\/\n public static function getMariaDbUser(): string\n {\n return self::get('MARIADB_USER', 'root');\n }\n\n \/**\n * Gets the MariaDB root password.\n *\/\n public static function getMariaDbPassword(): string\n {\n return self::getRequired('MARIADB_ROOT_PASSWORD');\n }\n\n \/**\n * Gets the Anthropic API key.\n *\/\n public static function getAnthropicApiKey(): string\n {\n return self::getRequired('ANTHROPIC_API_KEY');\n }\n\n \/**\n * Gets the Ollama host URL.\n *\/\n public static function getOllamaHost(): string\n {\n return self::get('OLLAMA_HOST', 'http:\/\/localhost:11434');\n }\n\n \/**\n * Gets the Qdrant host URL.\n *\/\n public static function getQdrantHost(): string\n {\n return self::get('QDRANT_HOST', 'http:\/\/localhost:6333');\n }",
"originalFile": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Infrastructure\\Config;\n\n\/\/ @responsibility: Zentrales Credential-Management aus Environment-Variablen\n\nuse RuntimeException;\n\nfinal class CredentialService\n{\n \/**\n * Gets the MariaDB root password.\n *\/\n public static function getMariaDbPassword(): string\n {\n return self::getRequired('MARIADB_ROOT_PASSWORD');\n }\n\n \/**\n * Gets the Anthropic API key.\n *\/\n public static function getAnthropicApiKey(): string\n {\n return self::getRequired('ANTHROPIC_API_KEY');\n }\n\n \/**\n * Gets the Ollama host URL.\n *\/\n public static function getOllamaHost(): string\n {\n return self::get('OLLAMA_HOST', 'http:\/\/localhost:11434');\n }\n\n \/**\n * Gets the Qdrant host URL.\n *\/\n public static function getQdrantHost(): string\n {\n return self::get('QDRANT_HOST', 'http:\/\/localhost:6333');\n }\n\n \/**\n * Gets an environment variable with a default value.\n *\/\n public static function get(string $key, string $default = ''): string\n {\n return $_ENV[$key] ?? $_SERVER[$key] ?? getenv($key) ?: $default;\n }\n\n \/**\n * Gets a required environment variable.\n *\n * @throws RuntimeException If the variable is not set\n *\/\n public static function getRequired(string $key): string\n {\n $value = self::get($key);\n\n if ($value === '') {\n throw new RuntimeException(\"Required environment variable not set: {$key}\");\n }\n\n return $value;\n }\n}\n",
"structuredPatch": [
{
"oldStart": 11,
"oldLines": 6,
"newStart": 11,
"newLines": 22,
"lines": [
" final class CredentialService",
" {",
" \/**",
"+ * Gets the MariaDB host.",
"+ *\/",
"+ public static function getMariaDbHost(): string",
"+ {",
"+ return self::get('MARIADB_HOST', 'localhost');",
"+ }",
"+",
"+ \/**",
"+ * Gets the MariaDB user.",
"+ *\/",
"+ public static function getMariaDbUser(): string",
"+ {",
"+ return self::get('MARIADB_USER', 'root');",
"+ }",
"+",
"+ \/**",
" * Gets the MariaDB root password.",
" *\/",
" public static function getMariaDbPassword(): string"
]
}
],
"userModified": false,
"replaceAll": false
}
}