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