| Conditions | 5 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 3 | protected function initList() |
|
| 22 | { |
||
| 23 | 3 | $headerList = array(); |
|
| 24 | 3 | foreach (explode("\r\n", trim($this->getInitData())) as $headerLine) { |
|
| 25 | 3 | if (empty($headerLine)) { |
|
| 26 | 1 | $headerList = array(); |
|
| 27 | 1 | continue; |
|
| 28 | } |
||
| 29 | if ( |
||
| 30 | 3 | ('HTTP/' == substr($headerLine, 0, 5)) || |
|
| 31 | 3 | ('Set-Cookie:' == substr($headerLine, 0, 11)) |
|
| 32 | ) { |
||
| 33 | 1 | continue; |
|
| 34 | } |
||
| 35 | 3 | $headerParams = explode(':', trim($headerLine), 2); |
|
| 36 | 3 | $key = trim($headerParams[0]); |
|
| 37 | 3 | $headerList[strtolower($key)] = new Header(array( |
|
| 38 | 3 | 'name' => $key, |
|
| 39 | 3 | 'value' => trim($headerParams[1]) |
|
| 40 | )); |
||
| 41 | } |
||
| 42 | 3 | $this->setList($headerList); |
|
| 43 | 3 | } |
|
| 45 |