You are here

private function StreamHandler::createSink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php \GuzzleHttp\Handler\StreamHandler::createSink()
1 call to StreamHandler::createSink()
StreamHandler::createResponse in vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

File

vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php, line 130

Class

StreamHandler
HTTP handler that uses PHP's HTTP stream wrapper.

Namespace

GuzzleHttp\Handler

Code

private function createSink(StreamInterface $stream, array $options) {
  if (!empty($options['stream'])) {
    return $stream;
  }
  $sink = isset($options['sink']) ? $options['sink'] : fopen('php://temp', 'r+');
  return is_string($sink) ? new Psr7\Stream(Psr7\try_fopen($sink, 'r+')) : Psr7\stream_for($sink);
}