| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | 100 | public function normalize(mixed $options, mixed $value): string |
|
| 8 | { |
||
| 9 | // remove new lines |
||
| 10 | 100 | $value = \str_replace(["\r\n", "\r", "\n"], ' ', \strval($value)); |
|
| 11 | |||
| 12 | // param is used for string length |
||
| 13 | 100 | $length = empty($this->length) ? null : \intval($this->length); |
|
| 14 | 100 | return \mb_substr(\strval($value), 0, $length, 'utf-8'); |
|
| 15 | } |
||
| 17 |