Skip to content

Commit 8cd59c1

Browse files
committed
trim
1 parent bb75c6c commit 8cd59c1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/SDK/Resource/Detectors/Host.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,12 @@ private function readFile(string $file): string|false
5555
set_error_handler(static fn () => true);
5656

5757
try {
58-
if (is_file($file) && is_readable($file)) {
59-
$contents = file_get_contents($file);
60-
if ($contents !== false) {
61-
return $contents;
62-
}
63-
}
58+
$contents = file_get_contents($file);
59+
60+
return is_string($contents) ? trim($contents) : false;
6461
} finally {
6562
restore_error_handler();
6663
}
67-
68-
return false;
6964
}
7065

7166
private function getLinuxId(): ?string

0 commit comments

Comments
 (0)