YoastSEO_Vendor\GuzzleHttp\Handler
StreamHandler::drain() private Yoast 1.0
Drains the source stream into the "sink" client option.
{} Это метод класса: StreamHandler{}
Хуков нет.
Возвращает
StreamInterface.
Использование
// private - только в коде основоного (родительского) класса $result = $this->drain( \YoastSEO_Vendor\Psr\Http\Message\StreamInterface $source, \YoastSEO_Vendor\Psr\Http\Message\StreamInterface $sink, $contentLength );
- $source(Streamчислоerface) (обязательный)
- $sink(Streamчислоerface) (обязательный)
- $contentLength(строка) (обязательный)
- Header specifying the amount of data to read.
Код StreamHandler::drain() StreamHandler::drain Yoast 15.6.2
private function drain(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $source, \YoastSEO_Vendor\Psr\Http\Message\StreamInterface $sink, $contentLength)
{
// If a content-length header is provided, then stop reading once
// that number of bytes has been read. This can prevent infinitely
// reading from a stream when dealing with servers that do not honor
// Connection: Close headers.
\YoastSEO_Vendor\GuzzleHttp\Psr7\copy_to_stream($source, $sink, \strlen($contentLength) > 0 && (int) $contentLength > 0 ? (int) $contentLength : -1);
$sink->seek(0);
$source->close();
return $sink;
}