diff --git a/src/QueryBuilder/AbstractQueryBuilder.php b/src/QueryBuilder/AbstractQueryBuilder.php index 71c26248d..2dc0c5df5 100644 --- a/src/QueryBuilder/AbstractQueryBuilder.php +++ b/src/QueryBuilder/AbstractQueryBuilder.php @@ -496,13 +496,7 @@ protected function prepareResource(mixed $value): string throw new InvalidArgumentException('Supported only stream resource type.'); } - $value = stream_get_contents($value); - - if ($value === false) { - throw new InvalidArgumentException('Cannot read stream contents.'); - } - - return $this->prepareBinary($value); + return $this->prepareBinary(stream_get_contents($value)); } /**