mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 07:32:15 +00:00
Default-namespace changes.
- Added new ClassNotFoundHttpException thrown when class is not found. - ClassNotFoundHttpException is now thrown when class/method is not found (backwards compatible). - Added unit-tests for default-namespace tests (rewrite + append cases).
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Pecee\SimpleRouter\Route;
|
||||
|
||||
use Pecee\Http\Middleware\IMiddleware;
|
||||
use Pecee\Http\Request;
|
||||
use Pecee\SimpleRouter\Exceptions\ClassNotFoundHttpException;
|
||||
use Pecee\SimpleRouter\Exceptions\NotFoundHttpException;
|
||||
use Pecee\SimpleRouter\Router;
|
||||
|
||||
@@ -95,7 +96,7 @@ abstract class Route implements IRoute
|
||||
}
|
||||
|
||||
if (method_exists($class, $method) === false) {
|
||||
throw new NotFoundHttpException(sprintf('Method "%s" does not exist in class "%s"', $method, $className), 404);
|
||||
throw new ClassNotFoundHttpException(sprintf('Method "%s" does not exist in class "%s"', $method, $className), 404, null, $className, $method);
|
||||
}
|
||||
|
||||
$router->debug('Executing callback');
|
||||
|
||||
Reference in New Issue
Block a user