/var/www/vhosts/ihelp.ro/httpdocs/vendor/laminas/laminas-diactoros/src/Response
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/laminas/laminas-diactoros/src/Response/XmlResponse.php (2087B)
createBody($xml),
$status,
$this->injectContentType('application/xml; charset=utf-8', $headers)
);
}
/**
* Create the message body.
*
* @param string|StreamInterface $xml
* @throws Exception\InvalidArgumentException If $xml is neither a string or stream.
*/
private function createBody($xml): StreamInterface
{
if ($xml instanceof StreamInterface) {
return $xml;
}
if (! is_string($xml)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid content (%s) provided to %s',
is_object($xml) ? $xml::class : gettype($xml),
self::class
));
}
$body = new Stream('php://temp', 'wb+');
$body->write($xml);
$body->rewind();
return $body;
}
}