| 1 | <?php |
||
| 8 | class ScriptWitness extends StaticBufferCollection implements ScriptWitnessInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param ScriptWitnessInterface $witness |
||
| 12 | * @return bool |
||
| 13 | */ |
||
| 14 | 84 | public function equals(ScriptWitnessInterface $witness) |
|
| 15 | { |
||
| 16 | 84 | $nStack = count($this); |
|
| 17 | 84 | if ($nStack !== count($witness)) { |
|
| 18 | return false; |
||
| 19 | } |
||
| 20 | |||
| 21 | 84 | for ($i = 0; $i < $nStack; $i++) { |
|
| 22 | 48 | if (false === $this->offsetGet($i)->equals($witness->offsetGet($i))) { |
|
| 23 | return false; |
||
| 24 | } |
||
| 25 | 16 | } |
|
| 26 | |||
| 27 | 84 | return true; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return \BitWasp\Buffertools\BufferInterface |
||
| 32 | */ |
||
| 33 | 102 | public function getBuffer() |
|
| 37 | } |
||
| 38 |