Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0438 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace Comodojo\Dispatcher\Response\Preprocessor; |
||
29 | 1 | public function consolidate() { |
|
30 | |||
31 | 1 | $this->response->headers->set('Content-Length: '.$this->response->content->length()); |
|
32 | |||
33 | 1 | $type = $this->response->content->type(); |
|
34 | 1 | $charset = $this->response->content->charset(); |
|
35 | |||
36 | 1 | if ( is_null($charset) ) { |
|
37 | $this->response->headers->set("Content-type", strtolower($type)); |
||
38 | } else { |
||
39 | 1 | $this->response->headers->set("Content-type", strtolower($type)."; charset=".$charset); |
|
40 | } |
||
41 | |||
42 | 1 | } |
|
43 | |||
45 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.