| Conditions | 5 |
| Paths | 12 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 69 | public function getMask($bit, $type) |
|
| 42 | { |
||
| 43 | 69 | $bit = (int) $bit >= 0 && (int) $bit <= 8 ? $bit : 0; |
|
| 44 | |||
| 45 | 69 | if ($type == self::MASK_LO) { |
|
| 46 | 67 | return $this->getBitMasks()[$bit][self::MASK_LO]; |
|
| 47 | 18 | } elseif ($type == self::MASK_HI) { |
|
| 48 | 17 | return $this->getBitMasks()[$bit][self::MASK_HI]; |
|
| 49 | } else { |
||
| 50 | 1 | throw new InvalidDataException('You can only request a lo or hi bit mask using this method'); |
|
| 51 | } |
||
| 52 | } |
||
| 53 | } |
||
| 54 |