We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08d325c commit 8eb624fCopy full SHA for 8eb624f
src/Persistence/IndexSerializer.php
@@ -300,11 +300,8 @@ public function readBm25(string $path): array
300
*/
301
private function checkedWrite($fh, string $data): void
302
{
303
- $len = strlen($data);
304
- $written = fwrite($fh, $data);
305
-
306
- if ($written !== $len) {
307
- throw new \RuntimeException("Failed to write {$len} bytes (wrote " . ($written === false ? '0' : $written) . ')');
+ if (@fwrite($fh, $data) === false) {
+ throw new \RuntimeException("Failed to write data");
308
}
309
310
0 commit comments