Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.9256 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6984 | 1 | public static function str_isubstr_after_last_separator( |
|
6985 | string $str, |
||
6986 | string $separator, |
||
6987 | string $encoding = 'UTF-8' |
||
6988 | ): string { |
||
6989 | 1 | if ($separator === '' || $str === '') { |
|
6990 | 1 | return ''; |
|
6991 | } |
||
6992 | |||
6993 | 1 | $offset = self::strripos($str, $separator); |
|
6994 | 1 | if ($offset === false) { |
|
6995 | 1 | return ''; |
|
6996 | } |
||
6997 | |||
6998 | 1 | if ($encoding === 'UTF-8') { |
|
6999 | 1 | return (string) \mb_substr( |
|
7000 | 1 | $str, |
|
7001 | 1 | $offset + (int) self::strlen($separator) |
|
7002 | ); |
||
7003 | } |
||
7004 | |||
7005 | return (string) self::substr( |
||
7006 | $str, |
||
7007 | $offset + (int) self::strlen($separator, $encoding), |
||
7008 | null, |
||
7009 | $encoding |
||
7010 | ); |
||
14816 |