| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 2 | private static function parseBip32DerivationValue(BufferInterface $value): array |
|
| 34 | { |
||
| 35 | 2 | $len = $value->getSize(); |
|
| 36 | 2 | if ($len % 4 !== 0 || $len === 0) { |
|
| 37 | throw new InvalidPSBTException("Invalid length for BIP32 derivation"); |
||
| 38 | } |
||
| 39 | |||
| 40 | 2 | $pieces = $len / 4; |
|
| 41 | 2 | $path = unpack("N{$pieces}", $value->getBinary()); |
|
| 42 | 2 | $fpr = array_shift($path); |
|
| 43 | 2 | return [$fpr, $path]; |
|
| 44 | } |
||
| 46 |