[TASK] Made abstract ExceptionHandler class an interface.

- Updated documentation to reflect new changes.
This commit is contained in:
Simon Sessingø
2016-04-09 09:42:57 +02:00
parent 257875c6f9
commit 7234415e24
4 changed files with 17 additions and 14 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
namespace Pecee\SimpleRouter;
use Pecee\Exception\RouterException;
use Pecee\Handler\ExceptionHandler;
use Pecee\Handler\IExceptionHandler;
use Pecee\Http\Middleware\BaseCsrfVerifier;
use Pecee\Http\Request;
@@ -187,8 +187,8 @@ class RouterBase {
protected function handleException(\Exception $e) {
if($this->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);