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