1 | <?php |
||
23 | class Signer |
||
24 | { |
||
25 | /** |
||
26 | * @var EcAdapterInterface |
||
27 | */ |
||
28 | private $ecAdapter; |
||
29 | |||
30 | /** |
||
31 | * @var TransactionInterface |
||
32 | */ |
||
33 | private $tx; |
||
34 | |||
35 | /** |
||
36 | * @var TransactionSignatureSerializer |
||
37 | */ |
||
38 | private $sigSerializer; |
||
39 | |||
40 | /** |
||
41 | * @var PublicKeySerializerInterface |
||
42 | */ |
||
43 | private $pubKeySerializer; |
||
44 | |||
45 | /** |
||
46 | * @var bool |
||
47 | */ |
||
48 | private $tolerateInvalidPublicKey = false; |
||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $padUnsignedMultisigs = false; |
||
54 | |||
55 | /** |
||
56 | * @var bool |
||
57 | */ |
||
58 | private $allowComplexScripts = false; |
||
59 | |||
60 | /** |
||
61 | * @var CheckerCreator |
||
62 | */ |
||
63 | private $checkerCreator; |
||
64 | |||
65 | /** |
||
66 | * @var InputSignerInterface[] |
||
67 | */ |
||
68 | private $signatureCreator = []; |
||
69 | |||
70 | /** |
||
71 | * TxWitnessSigner constructor. |
||
72 | * @param TransactionInterface $tx |
||
73 | * @param EcAdapterInterface $ecAdapter |
||
74 | */ |
||
75 | 109 | public function __construct(TransactionInterface $tx, EcAdapterInterface $ecAdapter = null) |
|
83 | |||
84 | /** |
||
85 | * @return $this |
||
86 | * @throws SignerException |
||
87 | */ |
||
88 | 1 | public function redeemBitcoinCash() |
|
93 | |||
94 | /** |
||
95 | * @param CheckerCreatorBase $checker |
||
96 | * @return $this |
||
97 | * @throws SignerException |
||
98 | */ |
||
99 | 1 | public function setCheckerCreator(CheckerCreatorBase $checker) |
|
108 | |||
109 | /** |
||
110 | * @param bool $setting |
||
111 | * @return $this |
||
112 | */ |
||
113 | 14 | public function padUnsignedMultisigs(bool $setting) |
|
118 | |||
119 | /** |
||
120 | * @param bool $setting |
||
121 | * @return $this |
||
122 | */ |
||
123 | 2 | public function tolerateInvalidPublicKey(bool $setting) |
|
128 | |||
129 | /** |
||
130 | * @param bool $setting |
||
131 | * @return $this |
||
132 | */ |
||
133 | 33 | public function allowComplexScripts(bool $setting) |
|
138 | |||
139 | /** |
||
140 | * @param int $nIn |
||
141 | * @param PrivateKeyInterface $key |
||
142 | * @param TransactionOutputInterface $txOut |
||
143 | * @param SignData $signData |
||
144 | * @param int $sigHashType |
||
145 | * @return $this |
||
146 | */ |
||
147 | 50 | public function sign(int $nIn, PrivateKeyInterface $key, TransactionOutputInterface $txOut, SignData $signData = null, int $sigHashType = SigHash::ALL) |
|
156 | |||
157 | /** |
||
158 | * @param int $nIn |
||
159 | * @param TransactionOutputInterface $txOut |
||
160 | * @param SignData|null $signData |
||
161 | * @return InputSignerInterface |
||
162 | */ |
||
163 | 108 | public function input(int $nIn, TransactionOutputInterface $txOut, SignData $signData = null): InputSignerInterface |
|
182 | |||
183 | /** |
||
184 | * @return TransactionInterface |
||
185 | */ |
||
186 | 84 | public function get(): TransactionInterface |
|
204 | } |
||
205 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.