/** * @param VersionInterface $version * @return bool */ public function matches(VersionInterface $version) { switch ($this->operator) { case self::OPERATOR_EQ: return $this->negate xor $version->equals($this->version); case self::OPERATOR_GT: return $this->negate xor $version->greaterThan($this->version); case self::OPERATOR_LT: return $this->negate xor $version->lessThan($this->version); // @codeCoverageIgnoreStart // @codeCoverageIgnoreStart default: throw SemverException::format('Invalid primitive operator "%s"', $this->operator); } // @codeCoverageIgnoreEnd }