src/Routing/PhrouteDispatcher.php
public function router(RouterInterface $router)
    {
        $instanceof = $router instanceof PhrouteRouter;

        $this->router = $router;

        $routes = $instanceof ? $router->routes() : $this->collect();

        $this->dispatcher = new BaseDispatcher($routes, $this->resolver);

        return $this;
    }
public function router(RouterInterface $router)
    {
        $instanceof = $router instanceof PhrouteRouter;

        $this->router = $router;

        $routes = $instanceof ? $router->routes() : $this->collect();

        $this->dispatcher = new BaseDispatcher($routes, $this->resolver);

        return $this;
    }
Sets the router and parse its available routes if needed.

@param  \Rougin\Slytherin\Routing\RouterInterface $router
@return self