Exemplo n.º 1
0
 public function getFieldValue($format = HeaderInterface::FORMAT_RAW)
 {
     if (HeaderInterface::FORMAT_ENCODED === $format) {
         return HeaderWrap::wrap($this->subject, $this);
     }
     return $this->subject;
 }
Exemplo n.º 2
0
 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     $value = HeaderWrap::mimeDecodeValue($value);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'date') {
         throw new Exception\InvalidArgumentException('Invalid header line for Date string');
     }
     $header = new static($value);
     return $header;
 }
 public static function fromString($headerLine)
 {
     list($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);
 }
 public static function fromString($headerLine)
 {
     list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
     $value = HeaderWrap::mimeDecodeValue($value);
     // check to ensure proper header type for this factory
     if (strtolower($name) !== 'mime-version') {
         throw new Exception\InvalidArgumentException('Invalid header line for MIME-Version string');
     }
     // Check for version, and set if found
     $header = new static();
     if (preg_match('/^(?P<version>\\d+\\.\\d+)$/', $value, $matches)) {
         $header->setVersion($matches['version']);
     }
     return $header;
 }
Exemplo n.º 5
0
 /**
  * Get the header value
  * 
  * @return string
  */
 public function getFieldValue()
 {
     return HeaderWrap::wrap($this->subject, $this);
 }
Exemplo n.º 6
0
 /**
  * Get the header value
  * 
  * @return string
  */
 public function getFieldValue()
 {
     $encoding = $this->getEncoding();
     if ($encoding == 'ASCII') {
         return HeaderWrap::wrap($this->subject, $this);
     }
     return HeaderWrap::mimeEncodeValue($this->subject, $encoding, true);
 }