Skip to content

Commit

Permalink
Update src/SDK/Resource/Detectors/Host.php
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Lightfoot-Wild <[email protected]>
  • Loading branch information
matt-hensley and ChrisLightfootWild authored Mar 28, 2024
1 parent b033796 commit ddb5180
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/SDK/Resource/Detectors/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,13 @@ public function getResource(): ResourceInfo

private function getMachineId(): ?string
{
switch ($this->os) {
case 'Linux':
{
return $this->getLinuxId();
}
case 'BSD':
{
return $this->getBsdId();
}
case 'Darwin':
{
return $this->getMacOsId();
}
case 'Windows':
{
return $this->getWindowsId();
}
}

return null;
return match ($this->os) {
'Linux' => $this->getLinuxId(),
'BSD' => $this->getBsdId(),
'Darwin' => $this->getMacOsId(),
'Windows' => $this->getWindowsId(),
default => null,
};
}

private function getLinuxId(): ?string
Expand Down

0 comments on commit ddb5180

Please sign in to comment.