Zend\Diactoros\Response\HtmlResponse::createBody PHP Method

createBody() private method

Create the message body.
private createBody ( string | Psr\Http\Message\StreamInterface $html ) : Psr\Http\Message\StreamInterface
$html string | Psr\Http\Message\StreamInterface
return Psr\Http\Message\StreamInterface
    private function createBody($html)
    {
        if ($html instanceof StreamInterface) {
            return $html;
        }
        if (!is_string($html)) {
            throw new InvalidArgumentException(sprintf('Invalid content (%s) provided to %s', is_object($html) ? get_class($html) : gettype($html), __CLASS__));
        }
        $body = new Stream('php://temp', 'wb+');
        $body->write($html);
        $body->rewind();
        return $body;
    }