Return the route url to call with bindings from configuration files.

@param $route
@return string
1894
protected function getRouteUrlWithBindings($route)
	{
		$urlRouteBindings = [];
		$urlInjectedBindings = [];

		$routeAction = $route->getAction();
		if (isset($routeAction['as'])) {
			if (isset($this->profile['api_calls_bindings'])) {
				foreach ($this->profile['api_calls_bindings'] as $apiCallsBinding) {
					$routesAliases = $apiCallsBinding['routes_aliases'];
					foreach ($routesAliases as $routeAlias) {
						if ($routeAlias == $routeAction['as']) {
							foreach ($apiCallsBinding['bindings'] as $binding) {
								if ($binding['in'] == 'query-route') {
									$urlRouteBindings[$binding['name']] = $binding['value'];
								} else if ($binding['in'] == 'query-injected') {
									$urlInjectedBindings[$binding['name']] = $binding['value'];
								}
							}
						}
					}
				}
			}
		}

		$url = $this->getRouteUri($route);

		foreach ($urlRouteBindings as $name => $value) {
			$url = str_replace('{'.$name.'}', $value, $url);
		}

		if (count($urlInjectedBindings) > 0) {
			$firstName = array_keys($urlInjectedBindings)[0];
			$firstValue = array_shift($urlInjectedBindings);
			$url .= '?' . $firstName . '=' . $firstValue;
			foreach ($urlInjectedBindings as $name => $value) {
				$url .= '&' . $name . '=' . $value;
			}
		}

		return $url;
	}
23195
private function getDomainRegex($route)
    {
        ReflectionHelper::invokePrivateMethod($route, 'compileRoute');
        $compiledRoute = ReflectionHelper::readPrivateProperty($route, 'compiled');

        return $compiledRoute->getHostRegex();
    }
405482
public function route($route = null)
    {
        if (null === $route) {
            return $this->route;
        }
        $this->route = $route;

        return $this;
    }
1330129
public function getControllerPath(Route $route)
    {
        $startDir = $this->paths['src'] . '/Controller/';

        if($route->getControllerPath() != null)
        {
            $fullPath = $startDir . $route->getControllerPath() . '/' . $route->getController();
        }
        else
        {
            $fullPath = $startDir . $route->getController();
        }

        if(file_exists($fullPath))
        {
            return $fullPath;
        }
        else
        {
            throw new \Exception("Controller not found at path " . $fullPath);
        }
    }
817239
protected static function funcGet($route)
    {
        $params = self::dynamic($route);
        //
        if (count($params) > 0) {
            return 'get(\''.$route.'\',function('.self::formatParams($params).')';
        } else {
            return 'get(\''.$route.'\',function()';
        }
    }
963941
public function getResourceConfigurationFromRequest($route)
    {
        // get just the base url without query string
        $route = parse_url($route, PHP_URL_PATH);

        // remove any slashes from begining/end
        $route = trim($route, " /");

        // get the base resource excluding any single identifiers
        $parts = explode('/', $route);
        $resource = is_numeric(end($parts)) ? prev($parts):end($parts);

        return $this->resourceConfigurationFor($resource);
    }
516169
protected function getRouteResource($route)
	{
		if (!config('openapischemas.resource_tag')) {
			$this->parentCommand->error('The "resource_tag" value in your apischemas.php configuration file must defined.');
			exit();
		}
		$routeAction = $route->getAction();
		list($class, $method) = explode('@', $routeAction['uses']);
		$reflection = new ReflectionClass($class);

		$comment = $reflection->getDocComment();
		if ($comment) {
			$docBlock = $this->docBlockFactory->create($comment);
			foreach ($docBlock->getTags() as $tag) {
				if ($tag->getName() === config('openapischemas.resource_tag')) {
					return $tag->getDescription()->render();
				}
			}
		}

		return null;
	}
1110610
private function applyGroupSettings(Route $route) : Route
    {
        $route->setRawPath($this->getGroupPath() . $route->getRawPath());
        $route->setRawHost($this->getGroupHost() . $route->getRawHost());

        if (!$route->usesCallable()) {
            $route->setControllerName($this->getGroupControllerNamespace() . $route->getControllerName());
        }

        $route->setSecure($this->groupIsSecure() || $route->isSecure());
        // The route's variable regexes take precedence over group regexes
        $route->setVarRegexes(array_merge($this->getVarRegexes(), $route->getVarRegexes()));
        $groupMiddleware = $this->getGroupMiddleware();

        if (count($groupMiddleware) > 0) {
            $route->addMiddleware($groupMiddleware, true);
        }

        return $route;
    }
840693
public function getUrl($page)
    {
        $request = Craft::$app->getRequest();

        // Get the query string params without the path or `pattern`
        parse_str($request->getQueryString(), $params);
        $pathParam = Craft::$app->getConfig()->getGeneral()->pathParam;
        unset($params[$pathParam], $params['pattern']);

        // Return the URL with the page param
        $params[$this->pageParam] = $page;
        return UrlHelper::url($request->getPathInfo(), $params);
    }
1130551
public static function parseRoute($route)
    {
        if (!empty($route)) {
            $url = [];
            $r = explode('&', $route);
            $url[0] = $r[0];
            unset($r[0]);
            foreach ($r as $part) {
                $part = explode('=', $part);
                $url[$part[0]] = isset($part[1]) ? $part[1] : '';
            }

            return $url;
        }

        return '#';
    }
579604
protected function getRouteScheme( $route )
	{
		if ( $route->httpOnly() )
		{
			return $this->getScheme( false );
		}
		elseif ( $route->httpsOnly() )
		{
			return $this->getScheme( true );
		}

		return $this->getScheme( null );
	}
184353
private function prepareRouteRegexp(string $route): string
    {
        if (!array_key_exists($route, self::$parsed_regexp)) {
            self::$parsed_regexp[$route] = preg_replace(array_keys($this->regexp_map), array_values($this->regexp_map), $route);
        }
        return self::$parsed_regexp[$route];
    }
669065
public function getUrl($path)
    {
        $regExp = '/\/\/|https?:/i';
        if (preg_match($regExp, $path)) {
            return $path;
        }
        try {
            $generated = call_user_func_array(
                [$this->getRouterGenerator(), 'generate'],
                func_get_args()
            );
        } catch (AuraException $caught) {
            $generated = false;
        }

        $basePath = rtrim($this->getRequest()->getBasePath(), '/');
        $path = $generated
            ? $generated
            : "{$basePath}/{$path}";

        return $path;
    }
912242
private function getRouteName($route = null)
    {
        return null === $route ? $this->request->attributes->get('_route') : $route;
    }
982434
public function getRoute($route = null)
    {
        $routes = $this->getConsole()->getRoutes($route);
        $l1 = 10; $l2 = 10; $l3 = 10;
        $list = "";
        foreach($routes as $route) {
            if($l1 < strlen($route[1])) {
                $l1 = strlen($route[1]);
            }
            if($l2 < strlen($route[0])) {
                $l2 = strlen($route[0]);
            }
            if($l3 < strlen($route[2])) {
                $l3 = strlen($route[2]);
            }
        }
        foreach($routes as $route) {
            $list .= 
"| $route[1]".str_repeat(' ',$l1-strlen($route[1]))." | $route[0]".str_repeat(' ',$l2-strlen($route[0]))." | $route[2]".str_repeat(' ',$l3-strlen($route[2]))." |
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
";
        }
        $list = "
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
| ".Colors::GREEN.Colors::BG_BLACK."URI".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l1-strlen('URI'))." | ".Colors::GREEN.Colors::BG_BLACK."Method".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l2-strlen('Method'))." | ".Colors::GREEN.Colors::BG_BLACK."Action".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l3-strlen('Action'))." |
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
".$list;
        return $list;
    }
740551
private function _getDispatchByRoute($route)
    {
        $pos = strpos($route, '/');
        if ($pos === false) {
            $parts = [$this, $route];
        } elseif ($pos > 0) {
            $parts = $this->module->createController($route);
        } else {
            $parts = Yii::$app->createController($route);
        }
        if (is_array($parts)) {
            /* @var $controller self */
            list($controller, $actionID) = $parts;
            $oldController = Yii::$app->controller;
            Yii::$app->controller = $controller;
        } else {
            throw new InvalidRouteException('Unable to resolve the dispatch request: ' . $route);
        }
        
        $dispatch = $controller->_createDispatch($actionID, false);
        
        if ($oldController !== null) {
            Yii::$app->controller = $oldController;
        }
        
        return $dispatch;
    }
165833
private function getMiddleWareFromRoute(Route $route)
    {
        if (!$route->group) {
            return $route->middleWare;
        }
        $groupMiddleWare = $this->getMiddleWareFromGroup($route->group);
        return \array_merge($groupMiddleWare, $route->middleWare);
    }