diff --git a/src/Version/Stability.php b/src/Version/Stability.php index 5b715c7..e141cba 100644 --- a/src/Version/Stability.php +++ b/src/Version/Stability.php @@ -2,12 +2,10 @@ namespace Version; -use JsonSchema\Exception\InvalidArgumentException; - class Stability { - const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p)\.{0,1}(\d*)'; + const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p|[D|d][E|e][V|v]|[D|d])\.{0,1}(\d*)'; /** * @var string @@ -109,7 +107,7 @@ private function toInt( $stability ) case 'patch': return 6; default: - throw new InvalidArgumentException( 'Invalid stability: ' . $stability ); + throw new \InvalidArgumentException( 'Invalid stability: ' . $stability ); } } } diff --git a/src/Version/Version.php b/src/Version/Version.php index 7c0c1e7..e9d3c81 100644 --- a/src/Version/Version.php +++ b/src/Version/Version.php @@ -208,8 +208,8 @@ public function __toString() $version = $this->major . '.' . $this->minor . '.' . - $this->revision . '.' . - (int)$this->micro; + $this->revision; + if($this->micro !== null) $version .= '.' . (int)$this->micro; } else { $version = $this->major; if ($this->minor) $version .= '-' . $this->minor;