/** * Create the message body. * * @param string|StreamInterface $html * @return StreamInterface * @throws InvalidArgumentException if $html is neither a string or stream. */ private function createBody($html) { if ($html instanceof StreamInterface) { return $html; } return Stream::createFromString($html); }