|
@@ 212-221 (lines=10) @@
|
| 209 |
|
* |
| 210 |
|
* @throws \InvalidArgumentException for invalid header names or values. |
| 211 |
|
*/ |
| 212 |
|
public function withHeader($name, $value) |
| 213 |
|
{ |
| 214 |
|
$this->validateHeaderName($name); |
| 215 |
|
|
| 216 |
|
$clone = clone $this; |
| 217 |
|
$clone->headers = clone $this->headers; |
| 218 |
|
$clone->headers->set($name, $value); |
| 219 |
|
|
| 220 |
|
return $clone; |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
/** |
| 224 |
|
* Return an instance with the specified header appended with the given value. |
|
@@ 240-249 (lines=10) @@
|
| 237 |
|
* |
| 238 |
|
* @throws \InvalidArgumentException for invalid header names or values. |
| 239 |
|
*/ |
| 240 |
|
public function withAddedHeader($name, $value) |
| 241 |
|
{ |
| 242 |
|
$this->validateHeaderName($name); |
| 243 |
|
|
| 244 |
|
$clone = clone $this; |
| 245 |
|
$clone->headers = clone $this->headers; |
| 246 |
|
$clone->headers->add($name, $value); |
| 247 |
|
|
| 248 |
|
return $clone; |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
/** |
| 252 |
|
* Return an instance without the specified header. |