Sets the anchor for the URI (the bit after the hash)

@param string $anchor null means remove previous
760284
public function set_anchor($anchor) {
        if (is_null($anchor)) {
            // Remove.
            $this->anchor = null;
        } else if ($anchor === '') {
            // Special case, used as empty link.
            $this->anchor = '';
        } else if (preg_match('|[a-zA-Z\_\:][a-zA-Z0-9\_\-\.\:]*|', $anchor)) {
            // Match the anchor against the NMTOKEN spec.
            $this->anchor = $anchor;
        } else {
            // Bad luck, no valid anchor found.
            $this->anchor = null;
        }
    }
1300994
private function ConsumeToken4( $token, $value, $anchor, $length )
	{
		$curr = new CurrentToken();
		$curr->token = $token;
		$curr->value = $value;
		$curr->anchor = $anchor;
		$curr->length = $length;
		array_push( $this->m_token, $curr );
	}
411115
protected function setUrlAttr($value = null)
    {
        if (!is_null($value)) {
            $this->url = $value;
            $this->pdfUrl = $value . '.pdf';
        }
    }
401980
public function setAnchor($anchor)
    {
        $allowedValues = $this->getAnchorAllowableValues();
        if (!in_array($anchor, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'anchor', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['anchor'] = $anchor;

        return $this;
    }
74087
public function set_align($location) {
        if (in_array($location, array('left', 'centre', 'center', 'right', 'fill', 'merge', 'justify', 'equal_space'))) {
            $this->set_h_align($location);

        } else if (in_array($location, array('top', 'vcentre', 'vcenter', 'bottom', 'vjustify', 'vequal_space'))) {
            $this->set_v_align($location);
        }
    }
807085
def set(cls, *anchors):
        
        cls.paths = sorted(flattened(anchors, split=SANITIZED | UNIQUE), reverse=True)
1233777
public function setRoot($root)
    {
        // do nothing if root isn't a valid prefix
        if (empty($root)) {
            return null;
        }

        // Kill slash padding and add a trailing slash afterwards
        $root = trim($root, '/');
        $root .= '/';
        $this->root = $root;
    }
155511
public function setSite($site)
    {
        if ($site === null) {
            $this->siteId = null;
            $this->site = null;

            return;
        }
        $this->siteId = $site->getSiteId();

        $this->site = $site;
    }
28032
public void setSiteRoot(String siteRoot) {

        if (siteRoot != null) {
            siteRoot = siteRoot.replaceFirst("/$", "");
        }
        m_siteRoot = siteRoot;
    }
1267551
protected function setHost($host)
    {
        $this->uriString = null;

        $this->host = (string) $host;

        return $this;
    }
169494
function setURL($url)
    {
        $this->url = $url;

        $u = parse_url($url);
        foreach ($u as $k => $v) {
            $this->debug("parsed URL $k = $v");
            $this->$k = $v;
        }

        // add any GET params to path
        if (isset($u['query']) && $u['query'] != '') {
            $this->path .= '?' . $u['query'];
        }

        // set default port
        if (!isset($u['port'])) {
            if ($u['scheme'] == 'https') {
                $this->port = 443;
            } else {
                $this->port = 80;
            }
        }

        $this->uri        = $this->path;
        $this->digest_uri = $this->uri;

        // build headers
        if (!isset($u['port'])) {
            $this->setHeader('Host', $this->host);
        } else {
            $this->setHeader('Host', $this->host . ':' . $this->port);
        }

        if (isset($u['user']) && $u['user'] != '') {
            $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
        }
    }
1214958
public function setAboutLink($link)
    {
        if (false === filter_var($link, FILTER_VALIDATE_URL)) {
            throw new \InvalidArgumentException(sprintf('Provided link %s is not a valid resource', $link));
        }

        $this->links['about']['href'] = (string) $link;
    }
26403
private static function setRoot($url)
    {
        $segements = explode('/', $url);
        $count = count($segements) - 2;

        $path = '';

        for ($i = 0; $i < $count; $i++) {
            $path .= '../';
        }

        Application::$path .= $path;

        return Application::$path;
    }
793113
public function setOverride($uri)
    {
        if (is_string($uri)) {
            $uri = new Uri($uri);
        }

        Assert::nullOrIsInstanceOf($uri, UriInterface::class, 'Expected a string, UriInterface, or null. Got: %s');

        $this->override = $uri;
    }
321674
function _set_uri_string($str)
	{
		// Filter out control characters
		$str = remove_invisible_characters($str, FALSE);

		// If the URI contains only a slash we'll kill it
		$this->uri_string = ($str == '/') ? '' : $str;
	}
700413
protected function prepareLink(string &$link = null): void
	{
		if ($link !== null) {
			if (Strings::endsWith($link, ':default')) {
				$link = substr($link, 0, -7);
			}
			$pos = strrpos($link, ':');
			if ($pos !== strlen($link)) {
				$link = substr($link, 0, $pos + 1);
			}
		}
	}
285659
public function editAction( $hash = NULL )
    {
        $address = $this->addressRepository->findOneByRegisteraddresshashIgnoreHidden($hash);

        if ($address) {
            $this->view->assign('hash', $hash);
            $this->view->assign('address', $address);
        }
    }