| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 55.56% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | abstract class Format |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Truncate a string and append '…' at the end |
||
| 15 | * |
||
| 16 | * @param string $string |
||
| 17 | * @param int $maxLength |
||
| 18 | * @param string $ellipsis the string to indicate truncation happened |
||
| 19 | * |
||
| 20 | * @return string truncated string |
||
| 21 | */ |
||
| 22 | 5 | public static function truncate(string $string, int $maxLength, string $ellipsis = '…'): string |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Shortcut to format money |
||
| 34 | * |
||
| 35 | * @param Money $money |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public static function money(Money $money): string |
||
| 47 |