Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public function putBit(bool $bit):BitBuffer{ |
||
50 | $bufIndex = floor($this->length / 8); |
||
51 | |||
52 | if(count($this->buffer) <= $bufIndex){ |
||
53 | $this->buffer[] = 0; |
||
54 | } |
||
55 | |||
56 | if($bit === true){ |
||
57 | $this->buffer[(int)$bufIndex] |= (0x80 >> ($this->length % 8)); |
||
58 | } |
||
59 | |||
60 | $this->length++; |
||
61 | |||
62 | return $this; |
||
63 | } |
||
66 |