fix: #3583045 Print empty tool:info inputs and outputs as JSON objects

Closes #3583045 (closed)

What changed

tool:info --format=json prints inputs and outputs as {} when a tool has none. Before, the empty PHP array encoded as [], while a tool with inputs got an object:

{"id": "no_requirements_tool", "inputs": {}, "outputs": {}, ...}

A consumer that reads both keys as maps no longer breaks on the empty case. outputInfoAsJson() falls back to an empty \ArrayObject, the same way the normalizer writes empty object members.

Testing

ToolInfoCommandTest::testToolInfoSimpleTool() adds a --format=json case asserting "inputs":{} and "outputs":{}. It fails without the fix. ToolInfoCommandTest passes; phpcs and phpstan are clean. The full suite is left to CI.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading