Skip to content

Commit

Permalink
class constants
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-hensley committed Mar 27, 2024
1 parent 94591e7 commit de38193
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SDK/Resource/Detectors/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
final class Host implements ResourceDetectorInterface
{
private const PATH_ETC_MACHINEID = 'etc/machine-id';
private const PATH_VAR_LIB_DBUS_MACHINEID = 'var/lib/dbus/machine-id';
private readonly string $dir;

public function __construct(string $dir = '/')
Expand Down Expand Up @@ -65,7 +67,7 @@ private function getMachineId()

private function getLinuxId(): string
{
$paths = ['etc/machine-id', 'var/lib/dbus/machine-id'];
$paths = [self::PATH_ETC_MACHINEID, self::PATH_VAR_LIB_DBUS_MACHINEID];

foreach ($paths as $path) {
if (file_exists($this->dir . $path)) {
Expand Down

0 comments on commit de38193

Please sign in to comment.