1 | <?php |
||
9 | class MultisigHD |
||
10 | { |
||
11 | /** |
||
12 | * @var int|string |
||
13 | */ |
||
14 | private $m; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $path; |
||
20 | |||
21 | /** |
||
22 | * @var HierarchicalKey[] |
||
23 | */ |
||
24 | private $keys; |
||
25 | |||
26 | /** |
||
27 | * @var HierarchicalKeySequence |
||
28 | */ |
||
29 | private $sequences; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $sort; |
||
35 | |||
36 | /** |
||
37 | * @param int|string $m |
||
38 | * @param string $path |
||
39 | * @param array $keys |
||
40 | * @param HierarchicalKeySequence $sequences |
||
41 | * @param bool $sort |
||
42 | */ |
||
43 | 42 | public function __construct($m, $path, array $keys, HierarchicalKeySequence $sequences, $sort = false) |
|
63 | |||
64 | /** |
||
65 | * @param HierarchicalKey[] $keys |
||
66 | * @return HierarchicalKey[] |
||
67 | */ |
||
68 | 30 | private function sortHierarchicalKeys(array $keys) |
|
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | 6 | public function getPath() |
|
82 | |||
83 | /** |
||
84 | * Return the composite keys of this MultisigHD wallet entry. |
||
85 | * This will strictly adhere to the choice on whether keys should be sorted, since this is done in the constructor. |
||
86 | * |
||
87 | * @return HierarchicalKey[] |
||
88 | */ |
||
89 | 30 | public function getKeys() |
|
93 | |||
94 | /** |
||
95 | * Returns the redeemScript. Note - keys are already sorted in the constructor, so this is not required in ScriptFactory. |
||
96 | * |
||
97 | * @return \BitWasp\Bitcoin\Script\ScriptInterface |
||
98 | */ |
||
99 | 18 | public function getRedeemScript() |
|
112 | |||
113 | /** |
||
114 | * @return \BitWasp\Bitcoin\Address\ScriptHashAddress |
||
115 | */ |
||
116 | 12 | public function getAddress() |
|
120 | |||
121 | /** |
||
122 | * Derive each HK child and produce a new MultisigHD object |
||
123 | * |
||
124 | * @param int|string $sequence |
||
125 | * @return MultisigHD |
||
126 | */ |
||
127 | 12 | public function deriveChild($sequence) |
|
148 | |||
149 | /** |
||
150 | * @param array|\stdClass|\Traversable $list |
||
151 | * @return MultisigHD |
||
152 | */ |
||
153 | 12 | public function deriveFromList($list) |
|
164 | |||
165 | /** |
||
166 | * Derive a path in the tree of available addresses. |
||
167 | * |
||
168 | * @param string $path |
||
169 | * @return MultisigHD |
||
170 | */ |
||
171 | 12 | public function derivePath($path) |
|
175 | } |
||
176 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.