Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
72 | public function getHeaderByName($name) |
||
73 | { |
||
74 | $headers = explode("\n", $this->headers); |
||
75 | |||
76 | foreach ($headers as $header) { |
||
77 | |||
78 | if (empty($header)) { |
||
79 | |||
80 | continue; |
||
81 | } |
||
82 | $keyVal = explode(": ", $header); |
||
83 | if ($keyVal[0] === $name) { |
||
84 | |||
85 | return trim($keyVal[1], " \t\n\r\0\x0B"); |
||
86 | } |
||
87 | } |
||
88 | |||
89 | throw new KeyNotFoundException($name); |
||
90 | } |
||
91 | } |
||
92 |