/** * Internal method for applying the settings from this MIME encoder to another * MIME encoder * * @param \r8\Transform\MIME $dest The encoder to apply the settings to * @return \r8\Transform\MIME Returns the input object */ public function apply(\r8\Transform\MIME $dest) { $dest->setLineLength($this->getLineLength()); $dest->setHeader($this->getHeader()); $dest->setInputEncoding($this->getInputEncoding()); $dest->setOutputEncoding($this->getOutputEncoding()); $dest->setEOL($this->getEOL()); return $dest; }
/** * Clears a custom header from this instance * * @param String $header The header to remove * @return \r8\Mail Returns a self reference */ public function removeCustomHeader($header) { $header = \r8\Transform\MIME::stripHeaderName($header); if (\r8\isEmpty($header)) { throw new \r8\Exception\Argument(0, 'Header Name', 'Must not be empty'); } if (isset($this->headers[$header])) { unset($this->headers[$header]); } return $this; }
public function testStripHeaderName() { $chars = implode("", array_map('chr', range(1, 255))); $this->assertSame('!"#$%&\'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNOP' . 'QRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', \r8\Transform\MIME::stripHeaderName($chars)); }