| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 5 | public function execute(string $value, int $length, string $suffix = '...'): string |
|
| 21 | { |
||
| 22 | 5 | $value = \strip_tags($value); |
|
| 23 | |||
| 24 | 5 | if (\mb_strlen($value, $this->encoding) > $length) { |
|
| 25 | 4 | return rtrim(mb_substr($value, 0, $length, $this->encoding)) . $suffix; |
|
| 26 | } |
||
| 27 | 1 | return $value; |
|
| 28 | } |
||
| 30 |