src/Viserio/Component/Routing/Dispatcher/SimpleDispatcher.php
protected function generateRouterFile(RouteCollectionContract $routes): void
    {
        $routerCompiler = new RouteTreeCompiler(new RouteTreeBuilder(), new RouteTreeOptimizer());
        $closure        = $routerCompiler->compile($routes->getRoutes());

        \file_put_contents($this->path, $closure, \LOCK_EX);
    }
protected function generateRouterFile(RouteCollectionContract $routes): void
    {
        $routerCompiler = new RouteTreeCompiler(new RouteTreeBuilder(), new RouteTreeOptimizer());
        $closure        = $routerCompiler->compile($routes->getRoutes());

        \file_put_contents($this->path, $closure, \LOCK_EX);
    }
Generates a router file with all routes.

@param \Viserio\Component\Contract\Routing\RouteCollection $routes

@return void