function Version::isGreaterThan
File
-
vendor/
phar-io/ version/ src/ Version.php, line 87
Class
Namespace
PharIo\VersionCode
public function isGreaterThan(Version $version) : bool {
if ($version->getMajor()
->getValue() > $this->getMajor()
->getValue()) {
return false;
}
if ($version->getMajor()
->getValue() < $this->getMajor()
->getValue()) {
return true;
}
if ($version->getMinor()
->getValue() > $this->getMinor()
->getValue()) {
return false;
}
if ($version->getMinor()
->getValue() < $this->getMinor()
->getValue()) {
return true;
}
if ($version->getPatch()
->getValue() > $this->getPatch()
->getValue()) {
return false;
}
if ($version->getPatch()
->getValue() < $this->getPatch()
->getValue()) {
return true;
}
if (!$version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) {
return false;
}
if ($version->hasPreReleaseSuffix() && !$this->hasPreReleaseSuffix()) {
return true;
}
if (!$version->hasPreReleaseSuffix() && $this->hasPreReleaseSuffix()) {
return false;
}
return $this->getPreReleaseSuffix()
->isGreaterThan($version->getPreReleaseSuffix());
}