-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleRouter: fix compatiblity with non-stringable (e.g. Closure) default parameter values #9
Conversation
…ault parameter values
f9abbe0
to
f99bbe9
Compare
cfc5e09
to
9f95c3b
Compare
…ault parameter values (#9) Since PHP 8.0
I changed it that this will work since PHP 8, because == behaves too loosely in < 8. |
…ault parameter values (#9) Since PHP 8.0
@dg Does this mean you do not intend to support routing of requests to I am not sure we understood each other. This use-case was originally supported, but it was broken by changes in d989c52. The problem is that MicroPresenter requires closure callback parameter, so the parameter value is non-stringable object and URL construction crashes on this if you try to use SimpleRouter. |
I get it now. |
No. I still don't get it :-) Can you give me a realworld example where constructUrl() is called and the parameter is closure? |
The original context for this PR is in this thread: https://pehapkari.slack.com/archives/C2R30BLKA/p1607199796381500 Here is example on top of current sandbox: |
Thanks |
The bug was intoroduced in d989c52.
SimpleRouter
should support non-stringable (e.g. Closure instance) default parameter values - a typical use case isNette:Micro
presenter.