Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | 92 | public function __construct(bool $first, bool ...$bits) |
|
21 | { |
||
22 | 92 | array_unshift($bits, $first); |
|
23 | 92 | $value = 0; |
|
24 | 92 | $stream = new Stream('bool'); |
|
25 | |||
26 | 92 | foreach ($bits as $i => $bit) { |
|
27 | 92 | $stream = $stream->add($bit); |
|
28 | 92 | $bit = (int) $bit; |
|
29 | 92 | $value |= $bit << $i; |
|
30 | } |
||
31 | |||
32 | 92 | $this->value = chr($value); |
|
33 | 92 | $this->original = $stream; |
|
34 | 92 | } |
|
76 |