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