if(false === $this->moved){ thrownewRuntimeException( sprintf('Uploaded file could not be moved to %s', $targetPath) ); }
privatefunctiondrain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface { // 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.
Psr7\Utils::copyToStream( $source, $sink, (\strlen($contentLength) > 0 && (int)$contentLength > 0) ? (int)$contentLength : -1 );