| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php namespace Comodojo\Dispatcher\Response\Preprocessor; |
||
| 29 | public function consolidate() { |
||
| 30 | |||
| 31 | $this->response->getHeaders()->set('Content-Length', $this->response->getContent()->length()); |
||
| 32 | |||
| 33 | $type = $this->response->getContent()->type(); |
||
| 34 | $charset = $this->response->getContent()->charset(); |
||
| 35 | |||
| 36 | if ( is_null($charset) ) { |
||
| 37 | $this->response->getHeaders()->set("Content-type", strtolower($type)); |
||
| 38 | } else { |
||
| 39 | $this->response->getHeaders()->set("Content-type", strtolower($type)."; charset=".$charset); |
||
| 40 | } |
||
| 41 | |||
| 42 | } |
||
| 43 | |||
| 45 |