diff --git a/src/SDK/Resource/Detectors/Host.php b/src/SDK/Resource/Detectors/Host.php index decf44af5..87a719754 100644 --- a/src/SDK/Resource/Detectors/Host.php +++ b/src/SDK/Resource/Detectors/Host.php @@ -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