Lines Matching refs:header
45 public function hasHeader($header) argument
47 return isset($this->headerNames[strtolower($header)]);
50 public function getHeader($header) argument
52 $header = strtolower($header);
54 if (!isset($this->headerNames[$header])) {
58 $header = $this->headerNames[$header];
60 return $this->headers[$header];
63 public function getHeaderLine($header) argument
65 return implode(', ', $this->getHeader($header));
68 public function withHeader($header, $value) argument
70 $this->assertHeader($header);
72 $normalized = strtolower($header);
78 $new->headerNames[$normalized] = $header;
79 $new->headers[$header] = $value;
84 public function withAddedHeader($header, $value) argument
86 $this->assertHeader($header);
88 $normalized = strtolower($header);
92 $header = $this->headerNames[$normalized];
93 $new->headers[$header] = array_merge($this->headers[$header], $value);
95 $new->headerNames[$normalized] = $header;
96 $new->headers[$header] = $value;
102 public function withoutHeader($header) argument
104 $normalized = strtolower($header);
110 $header = $this->headerNames[$normalized];
113 unset($new->headers[$header], $new->headerNames[$normalized]);
141 foreach ($headers as $header => $value) {
142 if (is_int($header)) {
145 $header = (string) $header;
147 $this->assertHeader($header);
149 $normalized = strtolower($header);
151 $header = $this->headerNames[$normalized];
152 $this->headers[$header] = array_merge($this->headers[$header], $value);
154 $this->headerNames[$normalized] = $header;
155 $this->headers[$header] = $value;
212 * @param mixed $header
216 private function assertHeader($header) argument
218 if (!is_string($header)) {
221 is_object($header) ? get_class($header) : gettype($header)
225 if ($header === '') {
229 if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
233 $header