コード例 #1
0
ファイル: Message.php プロジェクト: JanHuang/http
 /**
  * Return an instance without the specified header.
  *
  * Header resolution MUST be done without case-sensitivity.
  *
  * This method MUST be implemented in such a way as to retain the
  * immutability of the message, and MUST return an instance that removes
  * the named header.
  *
  * @param string $name Case-insensitive header field name to remove.
  * @return static
  */
 public function withoutHeader($name)
 {
     $name = strtoupper($name);
     if (!$this->hasHeader($name)) {
         return $this;
     }
     $this->header->remove($name);
     return $this;
 }
コード例 #2
0
ファイル: HeaderBagTest.php プロジェクト: JanHuang/http
 public function testToStringFoHeaderBag()
 {
     $headerBag = new HeaderBag(['X-Session-Id' => '111']);
     $this->assertEquals('X-Session-Id: 111' . "\r\n", (string) $headerBag);
     $headerBag->set('name', 'jan');
 }