Skip to content

Commit 9a5dff7

Browse files
committed
fix: do not throw exceptions when reading empty files
1 parent f8ab0b5 commit 9a5dff7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Util/FileSystemHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public function getContents(string $filePath): string
7878
throw new UnableToProcessFileException(sprintf('File path is a directory: "%s".', $filePath));
7979
}
8080

81-
$contents = @file_get_contents($filePath) ?: null;
81+
$contents = @file_get_contents($filePath);
8282

83-
if ($contents === null) {
83+
if ($contents === false) {
8484
throw new UnableToProcessFileException(sprintf('Could not open file for reading: "%s".', $filePath));
8585
}
8686

0 commit comments

Comments
 (0)