Skip to content
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

Improve the error if there is no controller #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

psohm
Copy link

@psohm psohm commented May 3, 2017

PHP can be configured to show errors when $this->map[$this->method] is called
In this case, the user can see the name of the lib
It shouldn't show it for security reason :)

PHP can be configured to show errors when $this->map[$this->method] is called
In this case, the user can see the name of the lib
It shouldn't show it for security reason :)
@tyzoid
Copy link
Collaborator

tyzoid commented Jul 18, 2017

This essentially wraps the function in an if statement, which the if statement inside does anyway?

If you are worried about this segment causing errors visible to the user:

$urls = $this->map[$this->method];
if (!$urls) return null;

then it would be better to rewrite this to not generate a warning in the first place:

if (empty($this->map[$this-method])) return null;

I'd probably say that this isn't too great a concern, as production environments would hide these warnings anyway, but I may have misunderstood your intent.

@tyzoid tyzoid added the On Hold label Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants