/** * Returns the major version qualified curie. This should be used by the MessageResolver, * event dispatchers, etc. where consumers will need to be able to reliably type hint or * locate classes and provide functionality for a given message, with the expectation * that a major revision is likely not compatible with another major revision of the * same message. * * e.g. "vendor:package:category:message:v1" * * @return string */ public function getCurieWithMajorRev() { return sprintf('%s:v%d', $this->getCurie(), $this->version->getMajor()); }
/** * Returns -1 if the current version is lower than the second, 0 if they are equal, * and 1 if the second is lower. * * @param SchemaVersion $version * * @return int */ public function compare(SchemaVersion $version) { return version_compare($this->toString(), $version->toString()); }