diff --git a/README.md b/README.md index 604518a..1ba92d0 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ This router is heavily inspired by the Laravel 5.* router, so anything you find ### Basic example +- ExceptionsHandlers must implement the `IExceptionHandler` interface. +- Middlewares must implement the `IMiddleware` interface. + ```php use Pecee\SimpleRouter\SimpleRouter; diff --git a/src/Pecee/Handler/ExceptionHandler.php b/src/Pecee/Handler/ExceptionHandler.php deleted file mode 100644 index 0c44a80..0000000 --- a/src/Pecee/Handler/ExceptionHandler.php +++ /dev/null @@ -1,11 +0,0 @@ -request->loadedRoute !== null && $this->request->loadedRoute->exceptionHandler !== null) { $handler = new $this->request->loadedRoute->exceptionHandler(); - if(!($handler instanceof ExceptionHandler)) { - throw new RouterException('Exception handler must be instanceof ExceptionHandler.'); + if(!($handler instanceof IExceptionHandler)) { + throw new RouterException('Exception handler must be instanceof IExceptionHandler.'); } $handler->handleError($this->request, $this->request->loadedRoute, $e);