1 | <?php |
||
5 | class IntBitField implements BitField |
||
6 | { |
||
7 | const C = 32; // on 64-bit machines this value can be 64, on 32-bit it needs to be 32. |
||
8 | protected $length; |
||
9 | protected $data; |
||
10 | |||
11 | public function __construct($length) |
||
21 | |||
22 | /** |
||
23 | * @param integer $bit set the bit |
||
24 | * @throws \InvalidArgumentException |
||
25 | */ |
||
26 | public function set($bit) |
||
34 | |||
35 | /** |
||
36 | * @param $bit |
||
37 | * @throws \InvalidArgumentException |
||
38 | */ |
||
39 | protected function guardAgainstBounds($bit) |
||
45 | |||
46 | /** |
||
47 | * @param integer $bit check if bit is set |
||
48 | * @return bool |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | public function has($bit) |
||
59 | } |
||
60 |