Conditions | 5 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.9256 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
6950 | 1 | public static function str_isubstr_after_first_separator( |
|
6951 | string $str, |
||
6952 | string $separator, |
||
6953 | string $encoding = 'UTF-8' |
||
6954 | ): string { |
||
6955 | 1 | if ($separator === '' || $str === '') { |
|
6956 | 1 | return ''; |
|
6957 | } |
||
6958 | |||
6959 | 1 | $offset = self::stripos($str, $separator); |
|
6960 | 1 | if ($offset === false) { |
|
6961 | 1 | return ''; |
|
6962 | } |
||
6963 | |||
6964 | 1 | if ($encoding === 'UTF-8') { |
|
6965 | 1 | return (string) \mb_substr( |
|
6966 | 1 | $str, |
|
6967 | 1 | $offset + (int) \mb_strlen($separator) |
|
6968 | ); |
||
6969 | } |
||
6970 | |||
6971 | return (string) self::substr( |
||
6972 | $str, |
||
6973 | $offset + (int) self::strlen($separator, $encoding), |
||
6974 | null, |
||
6975 | $encoding |
||
6976 | ); |
||
14823 |