diff --git a/src/Git/Value/SemVerVersion.php b/src/Git/Value/SemVerVersion.php index e4aa924e..7bd41899 100644 --- a/src/Git/Value/SemVerVersion.php +++ b/src/Git/Value/SemVerVersion.php @@ -91,14 +91,6 @@ public function lessThanEqual(self $other): bool private function compare(self $other): int { - $comparison = $this->major <=> $other->major; - - if ($comparison !== 0) { - return $comparison; - } - - $comparison = $this->minor <=> $other->minor; - - return $comparison !== 0 ? $comparison : $this->patch <=> $other->patch; + return [$this->major, $this->minor, $this->patch] <=> [$other->major, $other->minor, $other->patch]; } }