phpactor_rename_class
Update all references to a PHP class project-wide, including use statements, type hints, and instantiations, without modifying the file or class declaration.
Instructions
Update all REFERENCES to a PHP class project-wide (use statements, type hints, docblocks, instantiations). Does NOT rename the file or modify the class declaration — use phpactor_move_class for a full rename including file move and namespace update.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectPath": "<projectPath>",
"filePath": "<filePath>",
"newFqcn": "<newFqcn>"
},
"name": "phpactor_rename_class"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview changes without writing to files | |
| newFqcn | Yes | New fully qualified class name (e.g. App\Service\NewName) | |
| filePath | Yes | Path to the PHP file containing the class, relative to projectPath | |
| projectPath | Yes | Absolute path to the PHP project root |