insert_case
Adds a new case branch to a switch statement after a specified existing label, rejecting duplicates to keep router-style dispatch code accurate and free of dead branches.
Instructions
Add a branch to a switch. A case label is not a symbol, so no parser addresses it — but in a router-style file it is the extension point every new endpoint goes through. Anchored to a neighbouring case label, which stays stable across a batch the way line numbers do not. A label that already exists is rejected: PHP takes the first match and silently ignores the rest, so a duplicate is dead code that looks alive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | ||
| file_path | Yes | ||
| after_case | Yes | Label of the case to insert after, without quotes. | |
| instruction | Yes | What the new branch does. Say 'output only the case block'. | |
| allow_secrets | No |