Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
29 | 5 | public function filter($value) |
|
30 | { |
||
31 | 5 | if (!is_string($value) && !is_array($value)) { |
|
32 | 2 | return $value; |
|
33 | } |
||
34 | 3 | $result = @preg_replace($this->search, $this->replacement, $value); |
|
35 | 3 | if ($result === null) { |
|
36 | 1 | throw new FilterErrorException('An error occurred executing RegexReplace filter'); |
|
37 | } |
||
38 | |||
39 | 2 | return $result; |
|
40 | } |
||
41 | } |
||
42 |