{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/opt\/php-tools\/bootstrap.php",
"old_string": " \/\/ Namespace prefixes mapped to directories\n $prefixes = [\n 'Domain\\\\' => $projectPath . '\/src\/Domain\/',\n 'App\\\\' => $projectPath . '\/app\/',\n 'Tests\\\\' => $projectPath . '\/tests\/',\n ];",
"new_string": " \/\/ Namespace prefixes mapped to directories\n $prefixes = [\n 'Domain\\\\' => $projectPath . '\/src\/Domain\/',\n 'Infrastructure\\\\' => $projectPath . '\/src\/Infrastructure\/',\n 'UseCases\\\\' => $projectPath . '\/src\/UseCases\/',\n 'Framework\\\\' => $projectPath . '\/src\/Framework\/',\n 'Controller\\\\' => $projectPath . '\/src\/Controller\/',\n 'ServiceProvider\\\\' => $projectPath . '\/src\/ServiceProvider\/',\n 'App\\\\' => $projectPath . '\/app\/',\n 'Tests\\\\' => $projectPath . '\/tests\/',\n ];"
}
}
{
"tool_response": {
"filePath": "\/opt\/php-tools\/bootstrap.php",
"oldString": " \/\/ Namespace prefixes mapped to directories\n $prefixes = [\n 'Domain\\\\' => $projectPath . '\/src\/Domain\/',\n 'App\\\\' => $projectPath . '\/app\/',\n 'Tests\\\\' => $projectPath . '\/tests\/',\n ];",
"newString": " \/\/ Namespace prefixes mapped to directories\n $prefixes = [\n 'Domain\\\\' => $projectPath . '\/src\/Domain\/',\n 'Infrastructure\\\\' => $projectPath . '\/src\/Infrastructure\/',\n 'UseCases\\\\' => $projectPath . '\/src\/UseCases\/',\n 'Framework\\\\' => $projectPath . '\/src\/Framework\/',\n 'Controller\\\\' => $projectPath . '\/src\/Controller\/',\n 'ServiceProvider\\\\' => $projectPath . '\/src\/ServiceProvider\/',\n 'App\\\\' => $projectPath . '\/app\/',\n 'Tests\\\\' => $projectPath . '\/tests\/',\n ];",
"originalFile": "<?php\n\/**\n * PHPUnit Bootstrap\n * Loads project autoloader and test dependencies\n *\/\n\n\/\/ Project path (set via environment or default)\n$projectPath = getenv('PROJECT_PATH') ?: '\/var\/www\/dev.campus.systemische-tools.de';\n\n\/\/ Load PHPUnit autoloader\nrequire_once __DIR__ . '\/vendor\/autoload.php';\n\n\/\/ Register PSR-4 autoloader for project namespaces\nspl_autoload_register(function (string $class) use ($projectPath): void {\n \/\/ Namespace prefixes mapped to directories\n $prefixes = [\n 'Domain\\\\' => $projectPath . '\/src\/Domain\/',\n 'App\\\\' => $projectPath . '\/app\/',\n 'Tests\\\\' => $projectPath . '\/tests\/',\n ];\n\n foreach ($prefixes as $prefix => $baseDir) {\n $len = strlen($prefix);\n if (strncmp($prefix, $class, $len) === 0) {\n $relativeClass = substr($class, $len);\n $file = $baseDir . str_replace('\\\\', '\/', $relativeClass) . '.php';\n if (file_exists($file)) {\n require_once $file;\n return;\n }\n }\n }\n});\n\n\/\/ Define test constants\nif (!defined('PROJECT_PATH')) {\n define('PROJECT_PATH', $projectPath);\n}\nif (!defined('TEST_MODE')) {\n define('TEST_MODE', true);\n}\n",
"structuredPatch": [
{
"oldStart": 15,
"oldLines": 6,
"newStart": 15,
"newLines": 11,
"lines": [
" \/\/ Namespace prefixes mapped to directories",
" $prefixes = [",
" 'Domain\\\\' => $projectPath . '\/src\/Domain\/',",
"+ 'Infrastructure\\\\' => $projectPath . '\/src\/Infrastructure\/',",
"+ 'UseCases\\\\' => $projectPath . '\/src\/UseCases\/',",
"+ 'Framework\\\\' => $projectPath . '\/src\/Framework\/',",
"+ 'Controller\\\\' => $projectPath . '\/src\/Controller\/',",
"+ 'ServiceProvider\\\\' => $projectPath . '\/src\/ServiceProvider\/',",
" 'App\\\\' => $projectPath . '\/app\/',",
" 'Tests\\\\' => $projectPath . '\/tests\/',",
" ];"
]
}
],
"userModified": false,
"replaceAll": false
}
}