| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php namespace Comodojo\Dispatcher\Request; |
||
| 37 | 5 | private static function getHeaders() { |
|
| 38 | |||
| 39 | 5 | if (function_exists('getallheaders')) return getallheaders(); |
|
| 40 | |||
| 41 | 5 | $headers = array(); |
|
| 42 | |||
| 43 | 5 | foreach ($_SERVER as $name => $value) { |
|
| 44 | |||
| 45 | 5 | if (substr($name, 0, 5) == 'HTTP_') { |
|
| 46 | |||
| 47 | 5 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; |
|
| 48 | |||
| 49 | 5 | } |
|
| 50 | |||
| 51 | 5 | } |
|
| 52 | |||
| 53 | 5 | return $headers; |
|
| 54 | |||
| 58 |