Reads a DatePart value header in either RFC 2822 or RFC 822 format.

public ZBateson\MailMimeParser\Header\AbstractHeader::__construct(ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService, string $name, string $value)

Assigns the header's name and raw value, then calls getConsumer and setParseHeaderValue to extract a parsed value.

  • param \ConsumerService $consumerService For parsing the value.
  • param string $name Name of the header.
  • param string $value Value of the header.
public ZBateson\MailMimeParser\Header\AbstractHeader::__toString() : string
public getDateTime() : ?DateTime

Convenience method returning the part's DateTime object, or null if the date could not be parsed.

  • return \DateTime|null The parsed DateTime object.
public getDateTimeImmutable() : ?DateTimeImmutable

Returns a DateTimeImmutable for the part's DateTime object, or null if the date could not be parsed.

  • return \DateTimeImmutable|null The parsed DateTimeImmutable object.
public ZBateson\MailMimeParser\Header\AbstractHeader::getName() : string
public ZBateson\MailMimeParser\Header\AbstractHeader::getParts() : array
  • return \IHeaderPart[]
public ZBateson\MailMimeParser\Header\AbstractHeader::getRawValue() : string
public ZBateson\MailMimeParser\Header\AbstractHeader::getValue() : ?string
protected ZBateson\MailMimeParser\Header\AbstractHeader::$name = NULL
  • var string the name of the header
protected ZBateson\MailMimeParser\Header\AbstractHeader::$parts = NULL
  • var \IHeaderPart[] the header's parts (as returned from the consumer)
protected ZBateson\MailMimeParser\Header\AbstractHeader::$rawValue = NULL
  • var string the raw value
protected getConsumer(ZBateson\MailMimeParser\Header\Consumer\ConsumerService $consumerService)

Returns a DateConsumer.

  • return \Consumer\AbstractConsumer
protected ZBateson\MailMimeParser\Header\AbstractHeader::setParseHeaderValue(ZBateson\MailMimeParser\Header\Consumer\AbstractConsumer $consumer)

Calls the consumer and assigns the parsed parts to member variables.

The default implementation assigns the returned value to $this->part.

  • return static
© 2024 Bruce Wells
Search Namespaces \ Classes