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

Breadcrumb

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

class UnstructuredHeader

A Simple MIME Header.

@author Chris Corbyn

Hierarchy

  • class \Symfony\Component\Mime\Header\AbstractHeader implements \Symfony\Component\Mime\Header\HeaderInterface
    • class \Symfony\Component\Mime\Header\UnstructuredHeader extends \Symfony\Component\Mime\Header\AbstractHeader

Expanded class hierarchy of UnstructuredHeader

6 files declare their use of UnstructuredHeader
DkimSigner.php in vendor/symfony/mime/Crypto/DkimSigner.php
EmailHeaderSame.php in vendor/symfony/mime/Test/Constraint/EmailHeaderSame.php
MetadataHeader.php in vendor/symfony/mailer/Header/MetadataHeader.php
MimeMessageNormalizer.php in vendor/symfony/serializer/Normalizer/MimeMessageNormalizer.php
PhpMail.php in core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php

... See full list

File

vendor/symfony/mime/Header/UnstructuredHeader.php, line 19

Namespace

Symfony\Component\Mime\Header
View source
class UnstructuredHeader extends AbstractHeader {
    private string $value;
    public function __construct(string $name, string $value) {
        parent::__construct($name);
        $this->setValue($value);
    }
    
    /**
     * @param string $body
     */
    public function setBody(mixed $body) : void {
        $this->setValue($body);
    }
    public function getBody() : string {
        return $this->getValue();
    }
    
    /**
     * Get the (unencoded) value of this header.
     */
    public function getValue() : string {
        return $this->value;
    }
    
    /**
     * Set the (unencoded) value of this header.
     */
    public function setValue(string $value) : void {
        $this->value = $value;
    }
    
    /**
     * Get the value of this header prepared for rendering.
     */
    public function getBodyAsString() : string {
        return $this->encodeWords($this, $this->value);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractHeader::$charset private property
AbstractHeader::$encoder private static property 1
AbstractHeader::$lang private property
AbstractHeader::$lineLength private property
AbstractHeader::$name private property
AbstractHeader::createPhrase protected function Produces a compliant, formatted RFC 2822 'phrase' based on the string given.
AbstractHeader::encodeWords protected function Encode needed word tokens within a string of input.
AbstractHeader::generateTokenLines protected function Generates tokens from the given string which include CRLF as individual tokens.
AbstractHeader::getCharset public function Overrides HeaderInterface::getCharset
AbstractHeader::getEncodableWordTokens protected function Splits a string into tokens in blocks of words which can be encoded quickly.
AbstractHeader::getLanguage public function Overrides HeaderInterface::getLanguage
AbstractHeader::getMaxLineLength public function Overrides HeaderInterface::getMaxLineLength
AbstractHeader::getName public function Overrides HeaderInterface::getName
AbstractHeader::getTokenAsEncodedWord protected function Get a token as an encoded word for safe insertion into headers.
AbstractHeader::PHRASE_PATTERN public constant
AbstractHeader::setCharset public function Overrides HeaderInterface::setCharset
AbstractHeader::setLanguage public function Set the language used in this Header. Overrides HeaderInterface::setLanguage
AbstractHeader::setMaxLineLength public function Overrides HeaderInterface::setMaxLineLength
AbstractHeader::tokenNeedsEncoding protected function 2
AbstractHeader::tokensToString private function Takes an array of tokens which appear in the header and turns them into
an RFC 2822 compliant string, adding FWSP where needed.
AbstractHeader::toString public function Gets this Header rendered as a compliant string. Overrides HeaderInterface::toString
AbstractHeader::toTokens protected function Generate a list of all tokens in the final header. 1
UnstructuredHeader::$value private property
UnstructuredHeader::getBody public function Gets the body. Overrides HeaderInterface::getBody
UnstructuredHeader::getBodyAsString public function Get the value of this header prepared for rendering. Overrides HeaderInterface::getBodyAsString 1
UnstructuredHeader::getValue public function Get the (unencoded) value of this header.
UnstructuredHeader::setBody public function Overrides HeaderInterface::setBody
UnstructuredHeader::setValue public function Set the (unencoded) value of this header.
UnstructuredHeader::__construct public function Overrides AbstractHeader::__construct 3

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal