Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.1502 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6435 | 1 | public static function str_isubstr_after_last_separator( |
|
6436 | string $str, |
||
6437 | string $separator, |
||
6438 | string $encoding = 'UTF-8' |
||
6439 | ): string { |
||
6440 | 1 | if ($separator === '' || $str === '') { |
|
6441 | 1 | return ''; |
|
6442 | } |
||
6443 | |||
6444 | 1 | $offset = self::strripos($str, $separator); |
|
6445 | 1 | if ($offset === false) { |
|
6446 | 1 | return ''; |
|
6447 | } |
||
6448 | |||
6449 | 1 | if ($encoding === 'UTF-8') { |
|
6450 | 1 | return (string) \mb_substr( |
|
6451 | $str, |
||
6452 | 1 | $offset + (int) self::strlen($separator) |
|
6453 | ); |
||
6454 | } |
||
6455 | |||
6456 | return (string) self::substr( |
||
6457 | $str, |
||
6458 | $offset + (int) self::strlen($separator, $encoding), |
||
6459 | null, |
||
6460 | $encoding |
||
6461 | ); |
||
13722 |