Resolve the body of the message.

@return string
510344
private function resolveBody(Message $part)
    {
        $body = $part->getBody();
        foreach ($part->getParameters() as $search => $replace) {
            $body = str_replace($search, $replace, $body);
        }

        return $body;
    }
788935
public function getBody()
    {
        if ($this->body == false) {
            $body = @file_get_contents('php://input');
            if ($body != false && strlen(trim($body)) > 0) {
                // @codeCoverageIgnoreStart
                $this->body = $body;
            } else {
                // @codeCoverageIgnoreEnd
                $this->body = false;
            }
        }

        if ($this->body == false) {
            return false;
        }

        // @codeCoverageIgnoreStart
        return $body;
        // @codeCoverageIgnoreEnd
    }
219132
protected function getAlternativeBody()
    {
        $plain  = $this->getPlainBody();
        $html   = $this->getHtmlBody();

        $body   = array();
        $body[] = 'Content-Type: multipart/alternative; boundary="'.$this->boundary[0].'"';
        $body[] = null;
        $body[] = '--'.$this->boundary[0];

        foreach ($plain as $line) {
            $body[] = $line;
        }

        $body[] = '--'.$this->boundary[0];

        foreach ($html as $line) {
            $body[] = $line;
        }

        $body[] = '--'.$this->boundary[0].'--';
        $body[] = null;
        $body[] = null;

        return $body;
    }
31252
public function getBody()
    {
        $bodyStream = $this->getResponse()->getBody();
        $contents = $bodyStream->getContents();
        $bodyStream->rewind();

        return $contents;
    }
442138
protected function getRequestBody()
    {
        if (is_array($this->data)) {
            $this->data = http_build_query($this->data);
        }

        $this->prepareHeaders();

        $path = isset($this->uri['path']) ? $this->uri['path'] : '/';

        if (isset($this->uri['query'])) {
            $path .= "?{$this->uri['query']}";
        }

        $body = "{$this->method} $path HTTP/1.0\r\n";

        foreach ($this->headers as $name => $value) {
            $body .= "$name: " . trim($value) . "\r\n";
        }

        $body .= "\r\n{$this->data}";
        return $body;
    }
659682
public function getBody()
	{
		$id = $this->getMapID();
		$class = $this->getMapClass();
		$style = $this->getMapStyle();

		$output = "<div id='{$id}'";

		if (!empty($class))
		{
			$output .= " class='{$class}'";
		}

		if (!empty($style))
		{
			$output .= " style='{$style}'";
		}

		$output .= '></div>';

		return $output;
	}
1330393
public static function getBody()
    {
        $contentType = static::getHeader('Content-Type');
        $body = file_get_contents('php://input');

        if (mb_strpos($contentType,'application/x-www-form-urlencoded') === 0) {
            parse_str($body, $data);
            return $data;
        } else if (mb_strpos($contentType, 'application/json') === 0) {
            return json_decode($body, true);
        } else {
            return $body;
        }
    }
683876
protected function getPlainBody()
    {
        $charset    = $this->isUtf8($this->body['text/plain']) ? 'utf-8' : 'US-ASCII';
        $plane      = str_replace("\r", '', trim($this->body['text/plain']));
        $count      = ceil(strlen($plane) / 998);

        $body = array();
        $body[] = 'Content-Type: text/plain; charset='.$charset;
        $body[] = 'Content-Transfer-Encoding: 7bit';
        $body[] = null;

        for ($i = 0; $i < $count; $i++) {
            $body[] = substr($plane, ($i * 998), 998);
        }

        $body[] = null;
        $body[] = null;

        return $body;
    }
638803
public function getBody()
	{
		$number		= count( $this->parts );
		if( !$number )
			return '';

		$innerBoundary	= $this->mimeBoundary.'-1';

		$contents	= array( 'This is a multi-part message in MIME format.');
		$contents[]	= '--'.$this->mimeBoundary;
		$contents[]	= 'Content-Type: multipart/alternative;';
		$contents[]	= ' boundary="'.$innerBoundary.'"'.Net_Mail::$delimiter;
		foreach( $this->parts as $part )
			if( $part instanceof Net_Mail_Body )
				$contents[]	= '--'.$innerBoundary.Net_Mail::$delimiter.$part->render();
		$contents[]	= '--'.$innerBoundary.'--'.Net_Mail::$delimiter;

		foreach( $this->parts as $part )
			if( $part instanceof Net_Mail_Attachment )
				$contents[]	= '--'.$this->mimeBoundary.Net_Mail::$delimiter.$part->render();
		$contents[]	= '--'.$this->mimeBoundary.'--'.Net_Mail::$delimiter;
		return join( Net_Mail::$delimiter, $contents );
	}
769462
public function resolve(): string
    {
        $packageType = $this->composer->getPackage()->getType();
        return array_key_exists($packageType, $this->mapping)
            ? $this->mapping[$packageType]
            : 'default';
    }
619177
public function getBody()
    {
        // first we should render the body if it was not rendered before
        if (is_null($this->body)) {
            $this->set('body', '');
            // this is unnormal situation, notifying developer
            $this->app->logger->logLine('Email body is null: '.$this->get('from').' >> '.
                    date($this->app->getConfig('locale/timestamp', 'Y-m-d H:i:s')."\n"), null, 'error');
        }
        //if(!isset($this->mime['text'])&&!isset($this->mime['html'])){
        $this->setBody(is_object($this->body) ? $this->body->render() : $this->body);
        //}
        // sign should be added to all parts
        if (isset($this->mime['text'])) {
            $this->mime['text']['content'] .= $this->getSign();
        }
        if (isset($this->mime['html'])) {
            $this->mime['html']['content'] .= $this->getSign();
            // HTML should be converted to base 64
            //$this->mime['html']['content']=base64_encode($this->mime['html']['content']);
            // no, it should be splitted
            //$this->mime['html']['content']=wordwrap($this->mime['html']['content'],76,"\r\n",false);
        }
        // now as we have all the needed parts set
        $result = '';
        // first we have to add a simple text for non-Mime readers
        if (count($this->mime) == 0) {
            $result .= $this->plain_text;
        }
        // adding mail parts
        foreach ($this->mime as $name => $att) {
            list($type) = explode(';', $att['type']);
            // $name is a file name/part name, $att is a hash with type and content
            // depending on the type adding a header
            switch ($type) {
                case 'text/plain':
                    if (count($this->mime) > 0) {
                        $result .= "\n\n--".$this->getBoundary()."\n".
                        'Content-Type: '.$att['type'].'; ';
                    }
                    //$result.="charset=UTF-8";
                    break;

                case 'text/html':
                    if (count($this->mime) > 0) {
                        $result .= "\n\n--".$this->getBoundary()."\n".
                        'Content-Type: '.$att['type'].'; ';
                    }
                    $result .=
                        'Content-Transfer-Encoding: 8bit';
                    $att['content'] = rtrim(wordwrap($att['content']));
                    break;
            }
            if (isset($att['attachment'])) {
                $att['content'] = rtrim(chunk_split($att['content']));
                $result .= "name=$name\n".
                    "Content-transfer-encoding: base64\nContent-Disposition: attachment;";
            }
            $result .= "\n\n";
            $result .= $att['content'];
        }
        // if there were any attachments, trailing boundary should be added
        if (count($this->mime) > 0) {
            $result .= "\n--".$this->getBoundary()."\n";
        }

        return ltrim($result);
    }
85604
public function body()
    {
        if (!$this->bodyRendered) {
            $this->body = $this->renderBody();
            $this->bodyRendered = true;
        }
        return $this->body;
    }
437301
public function toString()
    {
        if (empty($this->headerSigners) && empty($this->bodySigners)) {
            return parent::toString();
        }

        $this->saveMessage();

        $this->doSign();

        $string = parent::toString();

        $this->restoreMessage();

        return $string;
    }
771231
public function getMessage()
    {
        $message = $this->getRawHeaders();

        // Only include the body in the message if the size is < 2MB
        $size = $this->body->getSize();
        if ($size < 2097152) {
            $message .= (string) $this->body;
        }

        return $message;
    }
591149
public function getBody() {
    $filename = $this->getFileName();
    $start_line = $this->getStartLine() - 1; // it's actually - 1, otherwise you wont get the function() block
    $end_line = $this->getEndLine();
    $length = $end_line - $start_line;
    $file_source = file($filename);
    $body = implode("", array_slice($file_source, $start_line, $length));

    return $body;
  }
105183
final public function getBodyText(): ?string
    {
        $iterator = new \RecursiveIteratorIterator($this, \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($iterator as $part) {
            if (self::SUBTYPE_PLAIN === $part->getSubtype()) {
                return $part->getDecodedContent();
            }
        }

        // If message has no parts, return content of message itself.
        if (self::SUBTYPE_PLAIN === $this->getSubtype()) {
            return $this->getDecodedContent();
        }

        return null;
    }
317930
protected function _prepareBody()
    {
        if($this->_streamingRequest) {
            $this->setHeaders(self::CONTENT_LENGTH,
                $this->raw_post_data->getTotalSize());
            return $this->raw_post_data;
        }
        else {
            return parent::_prepareBody();
        }
    }