Conditions | 4 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.0466 |
Changes | 0 |
1 | <?php |
||
20 | 2 | public function __construct(ScriptInterface $script) |
|
21 | { |
||
22 | 2 | $chunks = $script->getScriptParser()->decode(); |
|
23 | 2 | if (count($chunks) !== 5 || !$chunks[2]->isPush() || !$chunks[2]->getData() === 20) { |
|
24 | throw new \RuntimeException('Malformed pay-to-pubkey-hash script'); |
||
25 | } |
||
26 | |||
27 | /** @var BufferInterface $hash */ |
||
28 | 2 | $hash = $chunks[2]->getData(); |
|
29 | 2 | $this->hash = $hash; |
|
30 | 2 | } |
|
31 | |||
65 |