Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
22 | 15 | public function filterSingle($value, string $valueIdentifier = null) |
|
23 | { |
||
24 | // not a string, move along |
||
25 | 15 | if (! is_string($value)) { |
|
26 | 1 | return $value; |
|
27 | } |
||
28 | |||
29 | 14 | $function = '\trim'; |
|
30 | 14 | if ($this->options['side'] == 'left') { |
|
31 | 3 | $function = '\ltrim'; |
|
32 | 13 | } elseif ($this->options['side'] == 'right') { |
|
33 | 3 | $function = '\rtrim'; |
|
34 | } |
||
35 | 14 | return call_user_func($function, $value, $this->options['characters']); |
|
36 | } |
||
37 | } |
||
38 |