mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +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:
@@ -3,6 +3,7 @@
|
||||
namespace Pecee\SimpleRouter\ClassLoader;
|
||||
|
||||
use DI\Container;
|
||||
use Pecee\SimpleRouter\Exceptions\ClassNotFoundHttpException;
|
||||
use Pecee\SimpleRouter\Exceptions\NotFoundHttpException;
|
||||
|
||||
class ClassLoader implements IClassLoader
|
||||
@@ -28,7 +29,7 @@ class ClassLoader implements IClassLoader
|
||||
public function loadClass(string $class)
|
||||
{
|
||||
if (class_exists($class) === false) {
|
||||
throw new NotFoundHttpException(sprintf('Class "%s" does not exist', $class), 404);
|
||||
throw new ClassNotFoundHttpException(sprintf('Class "%s" does not exist', $class), 404, null, $class);
|
||||
}
|
||||
|
||||
if ($this->useDependencyInjection === true) {
|
||||
|
||||
Reference in New Issue
Block a user