Skip to content

Commit f777179

Browse files
committed
Backwards compatible string version of MacOSVersion
1 parent 9edbeba commit f777179

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Objects/MacOsVersion.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public function __construct($version = '0.1.0', $build = null)
3232
}
3333
}
3434

35+
/**
36+
* Override to remove build and pre-release from string version.
37+
*
38+
* @return string Current version string
39+
*/
40+
public function __toString(): string
41+
{
42+
return implode('.', [$this->major, $this->minor, $this->patch]);
43+
}
44+
3545
public function getName()
3646
{
3747
$major = (string) $this->getMajor();

0 commit comments

Comments
 (0)