Skip to content

Commit

Permalink
trim
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Dec 19, 2024
1 parent bb75c6c commit 8cd59c1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/SDK/Resource/Detectors/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ private function readFile(string $file): string|false
set_error_handler(static fn () => true);

try {
if (is_file($file) && is_readable($file)) {
$contents = file_get_contents($file);
if ($contents !== false) {
return $contents;
}
}
$contents = file_get_contents($file);

return is_string($contents) ? trim($contents) : false;
} finally {
restore_error_handler();
}

return false;
}

private function getLinuxId(): ?string
Expand Down

0 comments on commit 8cd59c1

Please sign in to comment.