You are here

public function Version::getVersion in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/sebastian/version/src/Version.php \SebastianBergmann\Version::getVersion()

Return value

string

File

vendor/sebastian/version/src/Version.php, line 35

Class

Version
@since Class available since Release 1.0.0

Namespace

SebastianBergmann

Code

public function getVersion() {
  if ($this->version === null) {
    if (count(explode('.', $this->release)) == 3) {
      $this->version = $this->release;
    }
    else {
      $this->version = $this->release . '-dev';
    }
    $git = $this
      ->getGitInformation($this->path);
    if ($git) {
      if (count(explode('.', $this->release)) == 3) {
        $this->version = $git;
      }
      else {
        $git = explode('-', $git);
        $this->version = $this->release . '-' . end($git);
      }
    }
  }
  return $this->version;
}