| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4.0582 |
| Changes | 2 | ||
| Bugs | 2 | Features | 1 |
| 1 | <?php |
||
| 23 | 2 | public function render($value) |
|
| 24 | { |
||
| 25 | 2 | if ($this->options->get('translation')) { |
|
| 26 | 2 | $value = $this |
|
| 27 | ->translator |
||
| 28 | 2 | ->trans($value); |
|
| 29 | 2 | } |
|
| 30 | 2 | $maximumStringLength = $this |
|
| 31 | ->options |
||
| 32 | 2 | ->get('length'); |
|
| 33 | 2 | $replaceString = $this |
|
| 34 | ->options |
||
| 35 | 2 | ->get('replace'); |
|
| 36 | |||
| 37 | // truncate string if required |
||
| 38 | 2 | if ($maximumStringLength && strlen($value) > $maximumStringLength) { |
|
| 39 | $value = substr($value, 0, $maximumStringLength) . $replaceString; |
||
| 40 | } |
||
| 41 | |||
| 42 | 2 | return $value; |
|
| 43 | } |
||
| 44 | |||
| 69 |