diff --git a/app/Controllers/Api/SubnetController.php b/app/Controllers/Api/SubnetController.php index 384e4a5..39c5f61 100644 --- a/app/Controllers/Api/SubnetController.php +++ b/app/Controllers/Api/SubnetController.php @@ -4,7 +4,7 @@ namespace App\Controllers\Api; use App\Services\Subnet; use Core\Http\Controllers\Controller; -use Core\Http\View\Engine; +use Core\Http\View\Render; use Exception; class SubnetController extends Controller diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php index f3d50e9..0b247c8 100644 --- a/app/Controllers/HomeController.php +++ b/app/Controllers/HomeController.php @@ -3,7 +3,7 @@ namespace App\Controllers; use Core\Http\Controllers\Controller; -use Core\Http\View\Engine; +use Core\Http\View\Render; class HomeController extends Controller { diff --git a/app/Controllers/TestController.php b/app/Controllers/TestController.php index 28bb40b..c44005e 100644 --- a/app/Controllers/TestController.php +++ b/app/Controllers/TestController.php @@ -3,7 +3,7 @@ namespace App\Controllers; use Core\Http\Controllers\Controller; -use Core\Http\View\Engine; +use Core\Http\View\Render; class TestController extends Controller { diff --git a/src/Factory/BootstrapFactory.php b/src/Factory/BootstrapFactory.php index 293bc36..08b02b7 100644 --- a/src/Factory/BootstrapFactory.php +++ b/src/Factory/BootstrapFactory.php @@ -7,7 +7,6 @@ use Core\Env\Env; use Core\Exceptions\ExceptionHandler; use Core\Exceptions\Exceptions\ClassNotFoundException; use Core\Http\Request; -use Core\Routing\RouteCollection; use Core\Routing\RouteDispatcher; class BootstrapFactory @@ -36,7 +35,7 @@ class BootstrapFactory app()->make(Application::class)->bootstrap(); // Dispatch router - app()->make(RouteDispatcher::class)->dispatch($this->request, RouteCollection::retrieve()); + app()->make(RouteDispatcher::class)->dispatch($this->request); } catch (\Exception $e) { ExceptionHandler::catchOne($e); } diff --git a/src/Routing/RouteDispatcher.php b/src/Routing/RouteDispatcher.php index 9106021..7b8c320 100644 --- a/src/Routing/RouteDispatcher.php +++ b/src/Routing/RouteDispatcher.php @@ -6,6 +6,7 @@ use Core\Exceptions\ExceptionHandler; use Core\Exceptions\Exceptions\NotFoundHttpException; use Core\Http\Request; use Core\Http\View\Engine; +use Core\Http\View\Render; use Exception; class RouteDispatcher @@ -17,24 +18,15 @@ class RouteDispatcher */ private Request $request; - /** - * Collection of all routes - * - * @var array - */ - private array $routeCollection; - /** * Dispatch the router dispatcher * * @param \Core\Http\Request $request - * @param array $routeCollection * @return void */ - public function dispatch(Request $request, array $routeCollection): void + public function dispatch(Request $request): void { - $this->request = $request; - $this->routeCollection = $routeCollection; + $this->request = $request; try { $route = $this->findMatchingRoute();