1 | <?php |
||
8 | class TransactionWitnessCollection extends StaticCollection |
||
9 | { |
||
10 | /** |
||
11 | * Initialize a new collection with a list of Inputs. |
||
12 | * |
||
13 | * @param TransactionInputWitnessInterface[] $inputs |
||
14 | */ |
||
15 | public function __construct(array $inputs = []) |
||
16 | { |
||
17 | $this->set = new \SplFixedArray(count($inputs)); |
||
18 | |||
19 | foreach ($inputs as $idx => $input) { |
||
20 | if (!$input instanceof TransactionInputWitnessInterface) { |
||
21 | throw new \InvalidArgumentException('Must provide TransactionInputWitnessInterface[] to TransactionWitnessCollection'); |
||
22 | } |
||
23 | |||
24 | $this->set->offsetSet($idx, $input); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | public function __clone() |
||
37 | |||
38 | /** |
||
39 | * @return TransactionInputWitnessInterface |
||
40 | */ |
||
41 | public function current() |
||
45 | |||
46 | /** |
||
47 | * @param int $offset |
||
48 | * @return TransactionInputWitnessInterface |
||
49 | */ |
||
50 | public function offsetGet($offset) |
||
58 | } |
||
59 |