| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | public function putBit(bool $bit):BitBuffer{ |
||
| 60 | $bufIndex = floor($this->length / 8); |
||
| 61 | |||
| 62 | if(count($this->buffer) <= $bufIndex){ |
||
| 63 | $this->buffer[] = 0; |
||
| 64 | } |
||
| 65 | |||
| 66 | if($bit === true){ |
||
| 67 | $this->buffer[(int)$bufIndex] |= (0x80 >> ($this->length % 8)); |
||
| 68 | } |
||
| 69 | |||
| 70 | $this->length++; |
||
| 71 | |||
| 72 | return $this; |
||
| 73 | } |
||
| 90 |