Closed githubjeka closed 1 year ago
Yeah that sounds a lot like a breaking change 😕
But I'm confused here, App\Model\RpcRequest $request
comes from your container? Because it sounds a lot like state (request object that depends on the current request being processed), which shouldn't be in a container (should only contain services/stateless objects).
App\Model\RpcRequest
could be a valid dto that has been checked and set in container on middleware level.
That DTO contains state. One great piece on that topic: https://igor.io/2013/03/31/stateless-services.html
Anyway, that's not the core of the topic here, but slightly related: I think the order of the resolvers was planned intentionally like that because:
request
service, as that would be a stateful service and that's usually considered bad practice to store it in a container$request
argument takes the requestI don't think we'll change this (at least for the use case discussed here).
Thanks for the clarification and your time.
Now https://github.com/PHP-DI/Slim-Bridge/blob/master/src/Bridge.php#L44
The code
throws
This looks more like a bug than consistent behavior, even though it has been documented. It is possible that this will lead to broken backward compatibility :/