Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
6999 | 6 | public static function str_offset_exists(string $str, int $offset, string $encoding = 'UTF-8'): bool |
|
7000 | { |
||
7001 | // init |
||
7002 | 6 | $length = (int) self::strlen($str, $encoding); |
|
7003 | |||
7004 | 6 | if ($offset >= 0) { |
|
7005 | 3 | return $length > $offset; |
|
7006 | } |
||
7007 | |||
7008 | 3 | return $length >= \abs($offset); |
|
7009 | } |
||
13722 |