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