Skip to content

Commit 9edbeba

Browse files
committed
Adds build to MacOSVersion
1 parent d856520 commit 9edbeba

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Objects/MacOs.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,14 @@ public function getVersion()
116116
{
117117
if ($v = $this->getShellExec('/usr/bin/sw_vers -productVersion'))
118118
{
119-
$this->_darwin = new MacOsVersion($v);
119+
if ($b = $this->getShellExec('/usr/bin/sw_vers -buildVersion'))
120+
{
121+
$this->_darwin = new MacOsVersion($v, $b);
122+
}
123+
else
124+
{
125+
$this->_darwin = new MacOsVersion($v);
126+
}
120127
}
121128
}
122129

src/Objects/MacOsVersion.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace DevCoding\Mac\Objects;
44

5-
use PHLAK\SemVer\Version;
6-
7-
class MacOsVersion extends Version
5+
class MacOsVersion extends SemanticVersion
86
{
97
const NAMES = [
108
'10' => [
@@ -24,19 +22,14 @@ class MacOsVersion extends Version
2422
],
2523
];
2624

27-
public function getMajor()
28-
{
29-
return $this->major;
30-
}
31-
32-
public function getMinor()
25+
public function __construct($version = '0.1.0', $build = null)
3326
{
34-
return $this->minor;
35-
}
27+
parent::__construct($version);
3628

37-
public function getRevision()
38-
{
39-
return $this->patch;
29+
if (!empty($build))
30+
{
31+
$this->setBuild($build);
32+
}
4033
}
4134

4235
public function getName()

0 commit comments

Comments
 (0)