Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6.1384 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
6349 | public static function str_isubstr_after_first_separator( |
||
6350 | string $str, |
||
6351 | string $separator, |
||
6352 | string $encoding = 'UTF-8' |
||
6353 | ): string { |
||
6354 | 1 | if ($separator === '' || $str === '') { |
|
6355 | 1 | return ''; |
|
6356 | } |
||
6357 | |||
6358 | 1 | $offset = self::stripos($str, $separator); |
|
6359 | 1 | if ($offset === false) { |
|
6360 | 1 | return ''; |
|
6361 | } |
||
6362 | |||
6363 | 1 | if ($encoding === 'UTF-8') { |
|
6364 | 1 | return (string) \mb_substr( |
|
6365 | 1 | $str, |
|
6366 | 1 | $offset + (int) \mb_strlen($separator) |
|
6367 | ); |
||
6368 | } |
||
6369 | |||
6370 | return (string) self::substr( |
||
6371 | $str, |
||
6372 | $offset + (int) self::strlen($separator, $encoding), |
||
6373 | null, |
||
6374 | $encoding |
||
6375 | ); |
||
13694 |