public function compareTo(Object $that) { if (!$that instanceof URI) { throw new \blaze\lang\IllegalArgumentException('Parameters must be of the type blaze\\net\\URI'); } $c = 0; if (($c = self::compareIgnoringCase($this->scheme, $that->scheme)) != 0) { return $c; } if ($this->isOpaque()) { if ($that->isOpaque()) { // Both opaque if (($c = self::compare($this->schemeSpecificPart, $that->schemeSpecificPart)) != 0) { return $c; } return self::compare($this->fragment, $that->fragment); } return +1; // Opaque > hierarchical } else { if ($that->isOpaque()) { return -1; // Hierarchical < opaque } } return $this->url->compareTo($that); }