Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setContent($content)
 {
     if (!is_array($content)) {
         throw new RuntimeException(sprintf('The %s only accepts arrays as content.', __CLASS__));
     }
     return parent::setContent($content);
 }
Example #2
0
 public function __construct($parts, $boundary = null, $statusCode = 200, array $headers = array())
 {
     if ($boundary === null) {
         $boundary = uniqid();
     }
     $this->boundary = $boundary;
     $headers["content-type"] = "multipart/mixed; boundary=" . $this->boundary;
     if (!isset($headers["content-transfer-encoding"])) {
         $headers["content-transfer-encoding"] = "binary";
     }
     parent::__construct($parts, $statusCode, $headers);
 }
Example #3
0
 public function __construct($url, $statusCode = 302, array $headers = array())
 {
     $headers['location'] = $url;
     parent::__construct($url, $statusCode, $headers);
 }