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

ErrorHandlerMiddleware::getRenderer($exception) needs interface #9851

Closed
dereuromark opened this issue Dec 7, 2016 · 2 comments
Closed

ErrorHandlerMiddleware::getRenderer($exception) needs interface #9851

dereuromark opened this issue Dec 7, 2016 · 2 comments
Milestone

Comments

@dereuromark
Copy link
Member

dereuromark commented Dec 7, 2016

There is currently no contract for what the getRenderer must return.
If it, however, does not contain a render() method it will fail. Currently that is not checked at all - or enforced.
The IDE hints this already as yellow - for a good reason.

So

protected function getRenderer($exception) {}

should typehint as

/**
 * @return \Cake\Error\ErrorHandlerInterface
 */

And the handlers (custom or core) must implement this interface containing

  • render()

method

Refs #9806

@dereuromark dereuromark added this to the 3.4.0 milestone Dec 7, 2016
@markstory
Copy link
Member

Another interface sounds reasonable to me.

@dereuromark
Copy link
Member Author

The name is more appropriately named ExceptionRendererInterface. PR open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants