| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | <?php namespace Comodojo\Dispatcher\Response\Preprocessor; |
||
| 24 | 1 | public function consolidate() { |
|
| 25 | |||
| 26 | 1 | $this->response->getHeaders()->set('Content-Length', $this->response->getContent()->length()); |
|
| 27 | |||
| 28 | 1 | $type = $this->response->getContent()->type(); |
|
| 29 | 1 | $charset = $this->response->getContent()->charset(); |
|
| 30 | |||
| 31 | 1 | if (empty($charset)) { |
|
| 32 | $this->response->getHeaders()->set("Content-type", strtolower($type)); |
||
| 33 | } else { |
||
| 34 | 1 | $this->response->getHeaders()->set("Content-type", strtolower($type)."; charset=".$charset); |
|
| 35 | } |
||
| 40 |