[HttpClient] fix php notice on push

This commit is contained in:
Nicolas Grekas 2019-09-10 08:36:23 +02:00
parent 92e64a1dfa
commit 6a7b77ecb2

View File

@ -64,7 +64,7 @@ final class CurlResponse implements ResponseInterface
}
if (null === $content = &$this->content) {
$content = true === $options['buffer'] ? fopen('php://temp', 'w+') : null;
$content = null === $options || true === $options['buffer'] ? fopen('php://temp', 'w+') : null;
} else {
// Move the pushed response to the activity list
if (ftell($content)) {
@ -349,7 +349,7 @@ final class CurlResponse implements ResponseInterface
return 0;
}
if ($options['buffer'] instanceof \Closure && !$content && $options['buffer']($headers)) {
if (null !== $options && $options['buffer'] instanceof \Closure && !$content && $options['buffer']($headers)) {
$content = fopen('php://temp', 'w+');
}