@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function put(int $num, int $length):BitBuffer{ |
60 | 60 | |
61 | 61 | for($i = 0; $i < $length; $i++){ |
62 | - $this->putBit((($num >> ($length - $i - 1)) & 1) === 1); |
|
62 | + $this->putBit((($num >> ($length - $i - 1))&1) === 1); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $this; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $toRead = $numBits < $bitsLeft ? $numBits : $bitsLeft; |
129 | 129 | $bitsToNotRead = $bitsLeft - $toRead; |
130 | 130 | $mask = (0xff >> (8 - $toRead)) << $bitsToNotRead; |
131 | - $result = ($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead; |
|
131 | + $result = ($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead; |
|
132 | 132 | $numBits -= $toRead; |
133 | 133 | $this->bitsRead += $toRead; |
134 | 134 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if($numBits > 0){ |
143 | 143 | |
144 | 144 | while($numBits >= 8){ |
145 | - $result = ($result << 8) | ($this->buffer[$this->bytesRead] & 0xff); |
|
145 | + $result = ($result << 8)|($this->buffer[$this->bytesRead]&0xff); |
|
146 | 146 | $this->bytesRead++; |
147 | 147 | $numBits -= 8; |
148 | 148 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if($numBits > 0){ |
152 | 152 | $bitsToNotRead = 8 - $numBits; |
153 | 153 | $mask = (0xff >> $bitsToNotRead) << $bitsToNotRead; |
154 | - $result = ($result << $numBits) | (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead); |
|
154 | + $result = ($result << $numBits)|(($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead); |
|
155 | 155 | $this->bitsRead += $numBits; |
156 | 156 | } |
157 | 157 | } |