bramus / router

A lightweight and simple object oriented PHP Router

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show if class or method does not exists

givanov95 opened this issue · comments

I'm Using the Router and extending it in my own class in order to change some methods and update the router without loosing changes. The invoke() method is private and I need to catch if no Class or method exists and return it.
I found that there is a catch of The ReflectionException in invoke() method, and I think that's exactly what I need but it's a private and I cannot override it. Is there another way to return message that a class or method does not exists, because now it shows an white screen, when the name of the class or method is wrong.

An addition to bramus/router that throws this Exception would be the best I guess. I am open to a PR that adds this behavior.

I have added the requested feature and just made a pull request.

#188

@bramus @givanov95 , did you have the chance to look at the pull request solution ? thanks in advance! xnan.

@bramus @givanov95 , did you have the chance to look at the pull request solution ? thanks in advance! xnan.

Yep, works great, thank you

Would You please merge it, thanks again!