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