Closed iGroovyboy closed 3 years ago
Hi, from the documentation of this package:
By default, Slim controllers have a strict signature: $request, $response, $args. The PHP-DI bridge offers a more flexible and developer friendly alternative.
This package does not support $args
in parameters. That's intentional.
What's the reason behind it? This fix would let all the installations with $args to be working as they are as well as current named parameters. And using the PHP-DI makes all the uses of Slim's signature basically useless with container resolution, doesn't it?
Well this how it was designed initially, the reason was simply "because I liked it better that way" (without $args
injection, which I found messy at the time).
I'm not 100% sure about the possible BC breaks of merging this. For example what if someone has an $args
argument already?
@mnapoli yes, i see what you mean. I guess you should close this PR.
Added 'args' parameter to support route placeholders as an Array type argument in resolved controller from container. Tests and UserController fixture updated; UserController->invite() shows basic usage where missing args caused error.
The 'native' Slim missing args argument caused following issues for the given test case fixture method arguments: