| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | 8 | protected static function _decodeFromDER(Identifier $identifier, |
|
| 59 | string $data, int &$offset): ElementBase |
||
| 60 | { |
||
| 61 | 8 | $idx = $offset; |
|
| 62 | 8 | Length::expectFromDER($data, $idx, 1); |
|
| 63 | 7 | $byte = ord($data[$idx++]); |
|
| 64 | 7 | if (0 !== $byte) { |
|
| 65 | 5 | if (0xff !== $byte) { |
|
| 66 | 1 | throw new DecodeException( |
|
| 67 | 1 | 'DER encoded boolean true must have all bits set to 1.'); |
|
| 68 | } |
||
| 69 | } |
||
| 70 | 6 | $offset = $idx; |
|
| 71 | 6 | return new self(0 !== $byte); |
|
| 72 | } |
||
| 74 |