Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
35 | 6 | public static function getHeaderSize($buffer) |
|
36 | { |
||
37 | 6 | $offset = 0; |
|
38 | 6 | $len = strlen($buffer); |
|
39 | |||
40 | 6 | while ($offset < $len) { |
|
41 | 6 | $c = ord($buffer[$offset]); |
|
42 | |||
43 | 6 | if (self::isMap($c) && $offset) { |
|
44 | 3 | break; |
|
45 | } |
||
46 | |||
47 | 6 | $offset += isset(self::$offsets[$c]) ? self::$offsets[$c] + 1 : 1; |
|
48 | } |
||
49 | |||
50 | 6 | return $offset; |
|
51 | } |
||
52 | |||
58 |