Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
50 | 5 | public function filter($value) |
|
51 | { |
||
52 | 5 | if ($this->toEncoding === null) { |
|
53 | 1 | return $value; |
|
54 | } |
||
55 | |||
56 | 4 | if ($this->fromEncoding === null) { |
|
57 | 2 | return mb_convert_encoding($value, $this->toEncoding); |
|
58 | } |
||
59 | |||
60 | 2 | return mb_convert_encoding($value, $this->toEncoding, $this->fromEncoding); |
|
61 | } |
||
62 | } |
||
63 |