-
Notifications
You must be signed in to change notification settings - Fork 18
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
Result object instead of exception when calling getCallback()? #29
Comments
Hi! Sounds good. It will be very nice of you to create a PR. |
Hey, sorry for the late answer, I've been sick and busy with work. I checked the lib today and before adding a new feature I looked at what the tools reported and other improvements like adding strict types because it's set to 7.4 anyways in composer.json. In the UrlParser trait this caused a type problem coming from this line if (array_key_exists(1, $result)) {
$this->parameters = $result[1];
} I have no idea how to fix it right now and I'm done for today. If you have any suggestions? Oh, and Pslam reports LOTS of infos. |
Hi!
What tools do you use? |
The code there has not been good before, the types make it just visible.
|
And what settings have you made? I have added strict-types=1 in all files in the project but still do not see any errors |
I don't mind implementing this and proving a PR but before I do so, I would like to know if there is a chance this will be accepted.
The exception is nothing exceptional, I'm expecting that some routes don't match. If, for some weird reason, an exception is prefered here, then it should be something specific, like "NoMatchingRouteException". Using \Exception is very generic.
I would expect to get a result object back that contains the actual route and handler and a method to verify the outcome of the result
if ($result->matched()) { $handler = $result->getHandler(); }
.The text was updated successfully, but these errors were encountered: