Automatically coerce route parameters from strings to typed values based on pattern matchers or explicit configuration. **Current behaviour:** All route variables are strings, even when matched by typed patterns like `{id:number}`. **Proposed behaviour:** ```php $router->map('GET', '/users/{id:number}', function (ServerRequestInterface $request, array $args) { // $args['id'] is now an int, not a string }); ``` **Considerations:** - This is a breaking change to the variable presentation contract - Needs careful design around what types are supported (int, float, bool) - Should respect the pattern matcher type (`:number` implies int) - Could be opt-in via strategy or router configuration - Interacts with the parameter injection feature (#356) **Target:** 7.x
Automatically coerce route parameters from strings to typed values based on pattern matchers or explicit configuration.
Current behaviour:
All route variables are strings, even when matched by typed patterns like
{id:number}.Proposed behaviour:
Considerations:
:numberimplies int)Target: 7.x