Returns a function creating a URL based on the given parameters.
@return \Closure A function creating a URL based on the given parameters.
347735
function getTo(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'url', ['scheme' => false]);
      return UrlHelper::to($args['url'], $args['scheme']);
    };
  }
313306
public function objectCreateUrl()
    {
        $actions = $this->listActions();
        if ($actions) {
            foreach ($actions as $action) {
                if (isset($action['ident']) && $action['ident'] === 'create') {
                    if (isset($action['url'])) {
                        $model = $this->proto();
                        if ($model->view()) {
                            $action['url'] = $model->render((string)$action['url']);
                        } else {
                            $action['url'] = preg_replace('~{{\s*id\s*}}~', $this->currentObjId, $action['url']);
                        }

                        return $action['url'];
                    }
                }
            }
        }

        return $this->objectEditUrl();
    }
1074770
public static function create($function_name, $parameters = NULL) {
    /** @var FunctionDeclarationNode $function */
    $function = Parser::parseSnippet("function $function_name() {}");
    if (is_array($parameters)) {
      foreach ($parameters as $parameter) {
        if (is_string($parameter)) {
          $parameter = ParameterNode::create($parameter);
        }
        $function->appendParameter($parameter);
      }
    }
    return $function;
  }
19247
public function buildRoutePattern()
	{
		$path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;

		return '~^' . preg_replace_callback(self::VAR_PATTERN, function($matches) {
			$this->parameter[] = $key = $matches[1];

			// Shorthand validation only if not set using the validation-method
			if (isset($matches[2]) && !isset($this->parameterPattern[$key])) {
				$this->parameterPattern[$key] = $matches[2];
			}
			return $this->buildParameterPattern($key);
		}, $path) . ($this->terminated ? '$' : '') . '~i';

	}
1287475
public function getUrl()
    {
        $this->validateMethod();

        $apiVersion = UrlManipulator::forceSlashPrefix($this->apiVersion);
        $endpoint   = UrlManipulator::forceSlashPrefix($this->getEndpoint());

        $url = $apiVersion.$endpoint;

        if ($this->getMethod() !== 'POST') {
            $params = $this->getParams();
            $url = UrlManipulator::appendParamsToUrl($url, $params);
        }

        return $url;
    }
916859
public function buildUrl()
    {

        if (isset($this->otherOptions['urlProcessRegEx'])
            && !empty($this->otherOptions['urlProcessRegEx'])
        ) {
            unset($this->otherOptions['urlProcessPattern']);
        }

        if (isset($this->otherOptions['urlCrawlRegEx'])
            && !empty($this->otherOptions['urlCrawlRegEx'])
        ) {
            unset($this->otherOptions['urlCrawlPattern']);
        }


        // Add token
        $url = 'token=' . $this->diffbot->getToken();

        if ($this->getName()) {
            // Add name
            $url .= '&name=' . $this->getName();

            // Add seeds
            if (!empty($this->seeds)) {
                $url .= '&seeds=' . implode('%20', array_map(function ($item) {
                        return urlencode($item);
                    }, $this->seeds));
            }

            // Add other options
            if (!empty($this->otherOptions)) {
                foreach ($this->otherOptions as $option => $value) {
                    $url .= '&' . $option . '=' . $value;
                }
            }

            // Add API link
            $url .= '&apiUrl=' . $this->getApiString();
        }

        return $url;
    }
713147
public function getUrl(): ?UrlGenerator
    {
        if (!$this->hasUrl()) {
            $this->setUrl($this->getDefaultUrl());
        }
        return $this->url;
    }
800524
public function getUrl()
    {
        if ($this->_url instanceof Closure) {
            return call_user_func($this->_url, $this);
        }

        return $this->_url ?: Yii::$app->request->referrer;
    }
503934
protected function getCallback($callback, array $parameters)
    {
        if ($callback instanceof Closure) {
            return $this->createCallableCallback($callback, $parameters);
        } elseif (is_string($callback)) {
            return $this->createStringCallback($callback, $parameters);
        } else {
            return;
        }
    }
1253839
public function answer(): callable
    {
        return function ($self, $arguments) {
            foreach ($this->iterations as $iteration) {
                foreach ($iteration->requests as $request) {
                    $this->invoker->callWith(
                        $request->callback(),
                        $request->finalArguments($self, $arguments)
                    );
                }

                if ($iteration instanceof GeneratorYieldFromIteration) {
                    foreach ($iteration->values as $key => $value) {
                        if ($key instanceof InstanceHandle) {
                            $key = $key->get();
                        }

                        if ($value instanceof InstanceHandle) {
                            $value = $value->get();
                        }

                        yield $key => $value;
                    }
                } else {
                    if ($iteration->hasKey) {
                        yield $iteration->key => $iteration->value;
                    } elseif ($iteration->hasValue) {
                        yield $iteration->value;
                    } else {
                        yield;
                    }
                }
            }

            foreach ($this->requests as $request) {
                $this->invoker->callWith(
                    $request->callback(),
                    $request->finalArguments($self, $arguments)
                );
            }

            if ($this->exception) {
                throw $this->exception;
            }

            if ($this->returnsSelf) {
                return $self;
            }

            if (null !== $this->returnsArgument) {
                return $arguments->get($this->returnsArgument);
            }

            return $this->returnValue;
        };
    }
802040
public function buildUrlWithParameters(array $parameters = [])
    {
        $url = $this->url;

        if (!$this->hasParameters() && !$parameters) {
            return $url;
        }

        foreach ($parameters as $key => $value) {
            $url = str_replace('{' . $key . '}', $value, $url);
        }
        return $url;
    }
669706
public function getUrl()
    {
        $url = self::BASE_FNS_URL . $this->getUrlPath();

        if ($this->getHttpMethod() === self::HTTP_METHOD_GET) {
            $url .= '?' . http_build_query($this->getPayload());
        }

        return $url;
    }
1200782
protected function routeUrl()
    {
        if (! $this->routeGenerator) {
            $this->routeGenerator = new RouteUrlGenerator($this, $this->request);
        }

        return $this->routeGenerator;
    }
144085
public function getURL() {
		return $this->scheme.'://'.$this->domain.$this->path.($this->parameters ? '?'.http_build_query($this->parameters) : '');
	}
473960
private function createCoreFunction(Closure $core): Closure {
        return function(ServerRequestInterface $request, ResponseInterface $response, Route $route) use($core) {
            return call_user_func_array($core, [&$request, &$response, &$route]);
        };
    }
412010
private function url()
    {
        if (isset($this->_options[self::ENTRY_BASEURL])) {
            return $this->_options[self::ENTRY_BASEURL];
        }

        // this is the fallback
        return Urls::URL_CURSOR;
    }
215149
public function getActionAsClosure()
    {
        if ($this->action instanceof \Closure)
        {
            return $this->action;
        }

        return function () {

            $action = $this->getActionAsCallable();

            return call_user_func_array($action, func_get_args());
        };
    }