Check if two url's are equal

@param KHttpUrlInterface $url
@return Boolean
330519
public function equals(KHttpUrlInterface $url)
    {
        $parts = array('scheme', 'host', 'port', 'path', 'query', 'fragment');

        foreach($parts as $part)
        {
            if($this->{$part} != $url->{$part}) {
                return false;
            }
        }

        return true;
    }
16907
public function matches($url)
    {
        $infos = parse_url($url);

        if ($this->expired()) {
            return false;
        }

        if (!$this->matchesScheme($infos['scheme'])) {
            return false;
        }

        if (!$this->matchesDomain($infos['host'])) {
            return false;
        }

        return $this->matchesPath($infos['path']);
    }
1121783
public function equals(KObjectInterface $user)
    {
        if($user instanceof KUserInterface)
        {
            if($user->getEmail() == $this->getEmail())
            {
                if($user->getPassword() == $this->getPassword()) {
                    return true;
                }
            }
        }

        return false;
    }
495648
@Override
    public boolean hostsEqual(URL url1, URL url2) {
        try {
            Boolean result = (Boolean) _hostsEqual.invoke(getInstance(),
                                                          new Object[] { url1, url2 });
            return result.booleanValue();
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "hostsEqual", new Object[] { url1, url2 });
            return false;
        }
    }
1343214
private function verifyUrl($url)
    {
        if (strpos($url, static::$_URL_VAR_CHARACTER) !== false) {
            throw new InvalidUrl(array(get_class($this), $url));
        }
        return true;
    }
46720
public static function isValidRelative(string $url, UrlInterface $baseUrl): bool
    {
        try {
            return self::myParse($baseUrl, $url);
        } catch (UrlPathLogicException $exception) {
            return false;
        }
    }
110855
protected function exists($url)
    {
        $shortener = Shortener::where('hash', hash('sha512', $url))->first();

        if (is_null($shortener)) {
            return false;
        }

        return route('shortener.show', [
            'url' => $this->hashids->encode($shortener->getKey()),
        ]);
    }
167906
public function compareUrlToProtocols(IUrl $url, array $protocols) {
        if (count($protocols) == 0) {
            return true;
        }

        return array_contains($protocols, $url->getProtocol());
    }
1164188
public function exists(string $url = null): bool
	{
		$urls = $this->getPageList();
		if (isset($urls[$url])) {
			return true;
		} else {
			return false;
		}
	}
1355678
protected function checkUrl($url)
    {
        if ($this->fullName) {
            $pos = strpos($this->fullName, '<');

            if (false !== $pos) {
                $str = substr($this->fullName, 0, $pos);
            } else {
                $str = $this->fullName;
            }

            if ($str && 0 !== stripos(str_replace('|', '/', $url), $str)) {
                return false;
            }
        }

        return true;
    }
24480
public function isEqualTo(UserInterface $user)
    {
        if ($user->getRoles() !== $this->getRoles()) {
            return false;
        }

        if ($this->username !== $user->getUsername()) {
            return false;
        }

        if ($this->id !== $user->getId()) {
            return false;
        }

        return true;
    }
29704
protected function _getUrl(KHttpUrlInterface $url)
    {
        if (!$url->getHost() && !$url->getScheme()) {
            $url->setUrl($this->getUrl()->toString(KHttpUrl::AUTHORITY));
        }

        return $url->toString(KHttpUrl::FULL, false);
    }
329334
public function supports($url)
    {
        $error = $this->validator->validate($url, [new Url()]);

        return 0 === count($error);
    }
711603
public static function isSameHost($url1, $url2, $strict = true) {
		return strcasecmp(self::getHost($url1, !$strict), self::getHost($url2, !$strict)) == 0;
	}
581041
public function has($crawlUrl): bool
    {
        if (! $crawlUrl instanceof CrawlUrl) {
            $crawlUrl = CrawlUrl::create($crawlUrl);
        }

        if ($this->contains($this->urls, $crawlUrl)) {
            return true;
        }

        return false;
    }
295201
public function equals($other, $parts=['scheme', 'user', 'host', 'path'])
    {
        $other = $other instanceof UrlContract ? $other : new static($other);
        $parts = (array)$parts;

        foreach ($parts as $part) {
            if ($part == 'path') {
                continue;
            }
            if ($this->$part != $other->$part) {
                return false;
            }
        }

        if (!in_array('path', $parts)) {
            return true;
        }

        return $this->path->equals($other->path);
    }
764161
public function match($url = null)
    {
        $match = parent::match($url);

        $find = $this->replaceParameters();

        if (false !== $find || true === $match) {
            return true;
        } else {
            return false;
        }
    }