PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
osta
/
old
/
include
/
laminas-mail
/
src
/
Header
<?php namespace Laminas\Mail\Header; use function explode; use function implode; use function strpos; /** * Generic class for Headers with multiple occurs in the same message */ class GenericMultiHeader extends GenericHeader implements MultipleHeadersInterface { /** * @param string $headerLine * @return array|GenericHeader|GenericMultiHeader|static */ public static function fromString($headerLine) { [$fieldName, $fieldValue] = GenericHeader::splitHeaderLine($headerLine); $fieldValue = HeaderWrap::mimeDecodeValue($fieldValue); if (strpos($fieldValue, ',')) { $headers = []; foreach (explode(',', $fieldValue) as $multiValue) { $headers[] = new static($fieldName, $multiValue); } return $headers; } return new static($fieldName, $fieldValue); } /** * Cast multiple header objects to a single string header * * @param array $headers * @throws Exception\InvalidArgumentException * @return string */ public function toStringMultipleHeaders(array $headers) { $name = $this->getFieldName(); $values = [$this->getFieldValue(HeaderInterface::FORMAT_ENCODED)]; foreach ($headers as $header) { if (! $header instanceof static) { throw new Exception\InvalidArgumentException( 'This method toStringMultipleHeaders was expecting an array of headers of the same type' ); } $values[] = $header->getFieldValue(HeaderInterface::FORMAT_ENCODED); } return $name . ': ' . implode(',', $values); } }
[+]
..
[-] MimeVersion.php
[edit]
[-] HeaderLocator.php
[edit]
[-] Subject.php
[edit]
[-] AbstractAddressList.php
[edit]
[-] MessageId.php
[edit]
[-] HeaderWrap.php
[edit]
[-] ContentTransferEncoding.php
[edit]
[-] HeaderLocatorInterface.php
[edit]
[-] UnstructuredInterface.php
[edit]
[-] GenericMultiHeader.php
[edit]
[-] GenericHeader.php
[edit]
[-] StructuredInterface.php
[edit]
[-] From.php
[edit]
[-] IdentificationField.php
[edit]
[-] HeaderLoader.php
[edit]
[-] ContentType.php
[edit]
[-] HeaderInterface.php
[edit]
[-] Date.php
[edit]
[-] HeaderValue.php
[edit]
[-] ListParser.php
[edit]
[-] References.php
[edit]
[+]
Exception
[-] MultipleHeadersInterface.php
[edit]
[-] To.php
[edit]
[-] ContentDisposition.php
[edit]
[-] Cc.php
[edit]
[-] ReplyTo.php
[edit]
[-] Received.php
[edit]
[-] HeaderName.php
[edit]
[-] InReplyTo.php
[edit]
[-] Sender.php
[edit]
[-] Bcc.php
[edit]