Add return tracking params into url

@param moodle_url $url A URL

@return string $url with return tracking params
3552
public function add_url_params(moodle_url $url) {
        if (empty($this->type)) {
            return $url;
        }

        $url->param('gpr_type', $this->type);

        if (!empty($this->plugin)) {
            $url->param('gpr_plugin', $this->plugin);
        }

        if (!empty($this->courseid)) {
            $url->param('gpr_courseid' ,$this->courseid);
        }

        if (!empty($this->userid)) {
            $url->param('gpr_userid', $this->userid);
        }

        if (!empty($this->groupid)) {
            $url->param('gpr_groupid', $this->groupid);
        }

        if (!empty($this->page)) {
            $url->param('gpr_page', $this->page);
        }

        return $url;
    }
1073468
private function getUrlParametersSeparator($url)
    {
        /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */
        $oStr = getStr();

        $urlSeparator = '&amp;';
        if ($oStr->preg_match('/(\?|&(amp;)?)$/i', $url)) {
            $urlSeparator = '';
        } elseif ($oStr->strpos($url, '?') === false) {
            $urlSeparator = '?';
        }

        return $urlSeparator;
    }
1056273
public static function post($url, $callback)
    {
        $route = new self($url);
        $route->setClosure($callback);
        $route->setMethod('post');

        $route->add();

        return $route;
    }
1297849
public function remove_success(moodle_url $url) {
        $html = $this->output->notification(get_string('communityremoved', 'hub'),
                    'notifysuccess');
        $continuebutton = new single_button($url,
                        get_string('continue', 'block_community'));
        $html .= html_writer::tag('div', $this->output->render($continuebutton),
                array('class' => 'continuebutton'));
        return $html;
    }
836956
protected function matchUrlDirectly($url)
    {
        foreach ($this->routes as $route) {
            if ($route->matchDirectly($url)) {
                return $route;
            }
        }
        return null;
    }
1124720
private function wrapUrl($url)
    {
        if ($this->balancer) {
            $url = sprintf('%s?url=%s', $this->balancer, urlencode($url));
        }

        $this->lastUrl = $url;

        return $url;
    }
1314137
private function applyBaseUrl(string $url): string
    {
        if ($this->baseUrl === null) {
            return $url;
        }

        if (substr($url, 0, 7) === "http://") {
            return $url;
        }

        if (substr($url, 0, 8) === "https://") {
            return $url;
        }

        $baseUrl = $this->baseUrl;

        if (substr($url, 0, 1) === "/") {
            $path = parse_url($baseUrl, \PHP_URL_PATH);
            if ($path !== null) {
                $baseUrl = substr($baseUrl, 0, strlen($path) * -1);
            }
        }

        return "{$baseUrl}/" . ltrim($url, "/");
    }
423766
protected function fetch_feed(string $url) : \moodle_simplepie {
        // Fetch the rss feed, using standard simplepie caching so feeds will be renewed only if cache has expired.
        \core_php_time_limit::raise(60);

        $feed = new \moodle_simplepie();

        // Set timeout for longer than normal to be agressive at fetching feeds if possible..
        $feed->set_timeout(40);
        $feed->set_cache_duration(0);
        $feed->set_feed_url($url);
        $feed->init();

        return $feed;
    }
20084
public static function base($url) {
        if (preg_match('#^(/|(ht|f)tps?://).+#', $url)) {
            return $url;
        }
        $url = preg_replace('#/?index\.html?$#', '', $url);

        return WWWROOT_DIR . $url;
    }
200280
public function get_login_url() {

        $callbackurl = self::callback_url();
        $params = array_merge(
            [
                'client_id' => $this->clientid,
                'response_type' => 'code',
                'redirect_uri' => $callbackurl->out(false),
                'state' => $this->returnurl->out_as_local_url(false),
                'scope' => $this->scope,
            ],
            $this->get_additional_login_parameters()
        );

        return new moodle_url($this->auth_url(), $params);
    }
1024111
public static function setUrl($url) {

		if(false === is_string($url) && false === $url instanceof URLParser) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or instance of sFire\\Utils\\URLParser, "%s" given', __METHOD__, gettype($url)), E_USER_ERROR);
		}

		if(true === is_string($url)) {
			$url = new URLParser($url);
		}

		static :: $url = $url;
		return $url;
	}
898278
public static function getBacklinksTotal($url = false)
    {
        $url   = parent::getUrl($url);
        $query = urlencode("link:{$url}");

        return self::getSearchResultsTotal($query);
    }
30061
protected function appendRedirectableGetParameters($url)
    {
        $concat = (parse_url($url, PHP_URL_QUERY) === null)
            ? '?'
            : '&';

        return
            $url . (
            $this->settingsManager->getRedirectableGetParameters()
                ? $concat . $this->settingsManager->getRedirectableGetParameters()
                : ''
            );
    }
359604
protected function extractUrlParameters($url)
    {
        $query = parse_url($url, PHP_URL_QUERY);
        parse_str($query, $params);

        return $params;
    }
615153
public function continue_button($url) {
        if (!($url instanceof moodle_url)) {
            $url = new moodle_url($url);
        }
        $button = new single_button($url, get_string('continue'), 'get', true);
        $button->class = 'continuebutton';

        return $this->render($button);
    }
656426
public function summarizeUrl(string $url): stdClass
    {
        $summary = $this->requester->get($this->buildUrl(['SM_URL' => $url]));

        return $this->cleanSummary($summary);
    }
991018
protected function fetchUrl(string $url): string
    {
        $curl = curl_init($url);
        curl_setopt_array($curl, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => $this->timeOut
        ]);
        $data = curl_exec($curl);
        $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $error = curl_error($curl);
        curl_close($curl);

        if ($error) {
            throw new FetchFailedException(sprintf("A cURL error occurred for \"%s\": %s", $url, $error));
        }

        if ($statusCode !== 200) {
            throw new FetchFailedException(sprintf("URL \"%s\" responded with status code %d.", $url, $statusCode));
        }

        if (!$data) {
            throw new FetchFailedException(sprintf("URL \"%s\" returned no data.", $url));
        }

        return $data;
    }