| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | function decodeOpN(int $op): int |
||
| 8 | { |
||
| 9 | 3151 | if ($op === Opcodes::OP_0) { |
|
| 10 | 286 | return 0; |
|
| 11 | } |
||
| 12 | |||
| 13 | 2929 | if (!($op === Opcodes::OP_1NEGATE || $op >= Opcodes::OP_1 && $op <= Opcodes::OP_16)) { |
|
| 14 | 69 | throw new \RuntimeException("Invalid opcode"); |
|
| 15 | } |
||
| 16 | |||
| 17 | 2887 | return (int) $op - (Opcodes::OP_1 - 1); |
|
| 18 | } |
||
| 19 | |||
| 32 |