You are here

private function StreamHandler::drain in Zircon Profile 8

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

Drains the source stream into the "sink" client option.

Parameters

StreamInterface $source:

StreamInterface $sink:

Return value

StreamInterface

Throws

\RuntimeException when the sink option is invalid.

1 call to StreamHandler::drain()
StreamHandler::createResponse in vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

File

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

Class

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

Namespace

GuzzleHttp\Handler

Code

private function drain(StreamInterface $source, StreamInterface $sink) {
  Psr7\copy_to_stream($source, $sink);
  $sink
    ->seek(0);
  $source
    ->close();
  return $sink;
}