/** * @param VersionInterface $that Version to compare to. * @return integer|double Negative is this is smaller, positive if that is smaller, or 0 if equals. */ public function compare(VersionInterface $that) { return $this->version->compare($that->getVersion()) ?: $this->prerelease->compare($that->getPrerelease()); }
public function getNormalizedString() { $operator = $this->negate ? self::$inversions[$this->operator] : $this->operator; return ($operator === self::OPERATOR_EQ ? '' : $operator) . $this->version->getNormalizedString(); }