-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
4.x - Add an advanced callable resolver #2787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adriansuter that's a really good solution so we entirely avoid any BC breaks. It's also opt-in for developers to implement which is awesome. Great work
Okay, there are a lot of changes in the unit tests. I tried to make sure that they test the non-advanced callable resolver as well as the advanced callable resolver. Two tests did not work as expected. But only if the callable resolver was non-advanced:
Any idea why? I think there is something wrong in the |
@l0gicgate Merged your PR. Slim is now using the |
This PR addresses #2780.
It defines a new
AdvancedCallableResolver
and a corresponding interface which extends the existingCallableResolverInterface
. The advanced callable resolver would be created by default in theApp
constructor (if none had been passed).The
MiddlewareDispatcher
would get the callable resolver as third optional param (non-BC). If it has one, and if the resolver is advanced, then the dispatcher would call theresolveMiddleware
method. If the resolver is not advanced or if there is not even a resolver available, the dispatcher would execute its own hard coded resolving.The
\Slim\Routing\Route
and the\Slim\Routing\RouteGroup
would check if the resolver is advanced. If so, they callresolveRoute
to perform the resolving. Otherwise they do as before.Note: All the test cases for the callable resolver had been copied and implemented for the advanced callable resolver. Some of them were "triplicated", because two had to throw exceptions and one not.