/** * Create a new route instance. * * @param array|string $methods * @param string $uri * @param mixed $action * * @return \Viserio\Contracts\Routing\Route */ protected function createRoute($methods, string $uri, $action) : RouteContract { // If the route is routing to a controller we will parse the route action into // an acceptable array format before registering it and creating this route // instance itself. We need to build the Closure that will call this out. if ($this->actionReferencesController($action)) { $action = $this->convertToControllerAction($action); } $route = new Route($methods, $this->prefix($uri), $action); $route->setContainer($this->getContainer()); $route->setInvoker($this->getInvoker()); $this->addWhereClausesToRoute($route); return $route; }