Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Version.php

function Version::isGreaterThan

File

vendor/phar-io/version/src/Version.php, line 87

Class

Version

Namespace

PharIo\Version

Code

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());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal