Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TextPart.php

function TextPart::getBody

2 calls to TextPart::getBody()
TextPart::bodyToString in vendor/symfony/mime/Part/TextPart.php
TextPart::__sleep in vendor/symfony/mime/Part/TextPart.php
1 method overrides TextPart::getBody()
MessagePart::getBody in vendor/symfony/mime/Part/MessagePart.php

File

vendor/symfony/mime/Part/TextPart.php, line 125

Class

TextPart
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\Mime\Part

Code

public function getBody() : string {
    if ($this->body instanceof File) {
        if (false === ($ret = @file_get_contents($this->body
            ->getPath()))) {
            throw new InvalidArgumentException(error_get_last()['message']);
        }
        return $ret;
    }
    if (null === $this->seekable) {
        return $this->body;
    }
    if ($this->seekable) {
        rewind($this->body);
    }
    return stream_get_contents($this->body) ?: '';
}
RSS feed
Powered by Drupal