Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.583 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
6379 | 1 | public static function str_isubstr_after_first_separator( |
|
6380 | string $str, |
||
6381 | string $separator, |
||
6382 | string $encoding = 'UTF-8' |
||
6383 | ): string { |
||
6384 | 1 | if ($separator === '' || $str === '') { |
|
6385 | 1 | return ''; |
|
6386 | } |
||
6387 | |||
6388 | 1 | $offset = self::stripos($str, $separator); |
|
6389 | 1 | if ($offset === false) { |
|
6390 | 1 | return ''; |
|
6391 | } |
||
6392 | |||
6393 | 1 | if ($encoding === 'UTF-8') { |
|
6394 | 1 | return (string) \mb_substr( |
|
6395 | 1 | $str, |
|
6396 | 1 | $offset + (int) \mb_strlen($separator) |
|
6397 | ); |
||
6398 | } |
||
6399 | |||
6400 | return (string) self::substr( |
||
6401 | $str, |
||
6402 | $offset + (int) self::strlen($separator, $encoding), |
||
6403 | null, |
||
6404 | $encoding |
||
6405 | ); |
||
13706 |