| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 20 | public static function v0(BufferInterface $program) |
|
| 46 | { |
||
| 47 | 20 | if ($program->getSize() === 20) { |
|
| 48 | 6 | return new self(self::V0, $program); |
|
| 49 | 14 | } else if ($program->getSize() === 32) { |
|
| 50 | 12 | return new self(self::V0, $program); |
|
| 51 | } else { |
||
| 52 | 2 | throw new \RuntimeException('Invalid size for V0 witness program - must be 20 or 32 bytes'); |
|
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 84 |