@@ -188,6 +188,9 @@ public function map(
188188 /**
189189 * Dispatch routes and run the application
190190 *
191+ * @throws InvalidControllerException
192+ * @throws InvalidMiddlewareException
193+ * @throws RouteNotFoundException
191194 * @throws Throwable
192195 */
193196 public function dispatch ()
@@ -211,7 +214,7 @@ public function dispatch()
211214 RouteAttributes::URI => $ routeAttributes [RouteAttributes::URI ],
212215 ];
213216
214- $ this ->publisher -> publish ($ this ->run ($ routeAttributes , $ routeParameters ));
217+ $ this ->publish ($ this ->run ($ routeAttributes , $ routeParameters ));
215218
216219 return ;
217220 }
@@ -226,6 +229,8 @@ public function dispatch()
226229 * @param array $routeAttributes
227230 * @param array $routeParameters
228231 * @return mixed|ResponseInterface
232+ * @throws InvalidControllerException
233+ * @throws InvalidMiddlewareException
229234 * @throws Throwable
230235 */
231236 private function run (array $ routeAttributes , array $ routeParameters )
@@ -284,6 +289,7 @@ private function runControllerThroughMiddleware(array $middleware, Closure $cont
284289 * @param Closure|callable|string $controller
285290 * @param array $parameters
286291 * @return ResponseInterface|null
292+ * @throws InvalidControllerException
287293 * @throws Throwable
288294 */
289295 private function runController ($ controller , array $ parameters )
@@ -525,7 +531,7 @@ public function patch(
525531 *
526532 * @param string $route
527533 * @param Closure|callable|string $controller
528- * @param \MiladRahimi\Router\Services\ Middleware|Middleware[] $middleware
534+ * @param Middleware|Middleware[] $middleware
529535 * @param string|null $domain
530536 * @param string|null $name
531537 */
@@ -613,6 +619,16 @@ public function currentRouteName()
613619 return null ;
614620 }
615621
622+ /**
623+ * Publish http response manually
624+ *
625+ * @param $httpResponse
626+ */
627+ public function publish ($ httpResponse )
628+ {
629+ $ this ->publisher ->publish ($ httpResponse );
630+ }
631+
616632 /**
617633 * Get current http request instance
618634 *
0 commit comments