| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | protected function str_limit_chars(string $string, int $limit): string |
||
| 23 | { |
||
| 24 | $string = trim(filter_var($string, FILTER_SANITIZE_SPECIAL_CHARS)); |
||
| 25 | if (mb_strlen($string) <= $limit) { |
||
| 26 | return $string; |
||
| 27 | } |
||
| 28 | |||
| 29 | $chars = mb_substr($string, 0, mb_strrpos(mb_substr($string, 0, $limit), " ")); |
||
| 30 | return $chars; |
||
| 31 | } |
||
| 60 |