Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
30 | protected function readUnsigned() |
||
31 | { |
||
32 | $data = $this->getStream()->read(3); |
||
33 | |||
34 | switch ($this->getByteOrder()) { |
||
35 | case ByteOrder::BIG_ENDIAN: |
||
36 | $format = 'N*'; |
||
37 | $data = $data . "\x00"; |
||
38 | break; |
||
39 | case ByteOrder::LITTLE_ENDIAN: |
||
40 | $format = 'V*'; |
||
41 | $data = "\x00" . $data; |
||
42 | break; |
||
43 | default: |
||
44 | $format = 'L*'; |
||
45 | $data = $data . "\x00"; |
||
46 | } |
||
47 | |||
48 | list(, $value) = unpack($format, $data); |
||
49 | return $value; |
||
50 | } |
||
51 | |||
83 |