1 | <?php |
||
19 | class Transaction extends Serializable implements TransactionInterface |
||
20 | { |
||
21 | use FunctionAliasArrayAccess; |
||
22 | |||
23 | /** |
||
24 | * @var int|string |
||
25 | */ |
||
26 | private $version; |
||
27 | |||
28 | /** |
||
29 | * @var TransactionInputCollection |
||
30 | */ |
||
31 | private $inputs; |
||
32 | |||
33 | /** |
||
34 | * @var TransactionOutputCollection |
||
35 | */ |
||
36 | private $outputs; |
||
37 | |||
38 | /** |
||
39 | * @var TransactionWitnessCollection |
||
40 | */ |
||
41 | private $witness; |
||
42 | |||
43 | /** |
||
44 | * @var int|string |
||
45 | */ |
||
46 | private $lockTime; |
||
47 | |||
48 | /** |
||
49 | * Transaction constructor. |
||
50 | * |
||
51 | * @param int $nVersion |
||
52 | * @param TransactionInputCollection|null $inputs |
||
53 | * @param TransactionOutputCollection|null $outputs |
||
54 | * @param TransactionWitnessCollection|null $witness |
||
55 | * @param int $nLockTime |
||
56 | */ |
||
57 | 1986 | public function __construct( |
|
85 | |||
86 | /** |
||
87 | * @return Transaction |
||
88 | */ |
||
89 | 165 | public function __clone() |
|
94 | |||
95 | /** |
||
96 | * @return BufferInterface |
||
97 | */ |
||
98 | 183 | public function getTxHash() |
|
102 | |||
103 | /** |
||
104 | * @return BufferInterface |
||
105 | */ |
||
106 | 183 | public function getTxId() |
|
110 | |||
111 | /** |
||
112 | * @return \BitWasp\Buffertools\BufferInterface |
||
113 | */ |
||
114 | public function getWitnessTxId() |
||
118 | |||
119 | /** |
||
120 | * @return int|string |
||
121 | */ |
||
122 | 375 | public function getVersion() |
|
126 | |||
127 | /** |
||
128 | * Get the array of inputs in the transaction |
||
129 | * |
||
130 | * @return TransactionInputCollection |
||
131 | */ |
||
132 | 1050 | public function getInputs() |
|
136 | |||
137 | /** |
||
138 | * @param int $index |
||
139 | * @return TransactionInputInterface |
||
140 | */ |
||
141 | 159 | public function getInput($index) |
|
145 | |||
146 | /** |
||
147 | * Get Outputs |
||
148 | * |
||
149 | * @return TransactionOutputCollection |
||
150 | */ |
||
151 | 384 | public function getOutputs() |
|
155 | |||
156 | /** |
||
157 | * @param int $vout |
||
158 | * @return TransactionOutputInterface |
||
159 | */ |
||
160 | 153 | public function getOutput($vout) |
|
164 | |||
165 | /** |
||
166 | * @return TransactionWitnessCollection |
||
167 | */ |
||
168 | 147 | public function getWitnesses() |
|
172 | |||
173 | /** |
||
174 | * @return ScriptWitnessInterface |
||
175 | */ |
||
176 | public function getWitness($index) |
||
180 | |||
181 | /** |
||
182 | * @param int $vout |
||
183 | * @return OutPointInterface |
||
184 | */ |
||
185 | 24 | public function makeOutpoint($vout) |
|
190 | |||
191 | /** |
||
192 | * @param int $vout |
||
193 | * @return Utxo |
||
194 | */ |
||
195 | public function makeUtxo($vout) |
||
204 | |||
205 | /** |
||
206 | * Get Lock Time |
||
207 | * |
||
208 | * @return int|string |
||
209 | */ |
||
210 | 381 | public function getLockTime() |
|
214 | |||
215 | /** |
||
216 | * @return \BitWasp\Bitcoin\Transaction\SignatureHash\SigHash |
||
217 | */ |
||
218 | 96 | public function getSignatureHash() |
|
222 | |||
223 | /** |
||
224 | * @return int|string |
||
225 | */ |
||
226 | 6 | public function getValueOut() |
|
236 | |||
237 | /** |
||
238 | * @return bool |
||
239 | */ |
||
240 | 6 | public function isCoinbase() |
|
244 | |||
245 | /** |
||
246 | * @return Validator |
||
247 | */ |
||
248 | 54 | public function validator() |
|
252 | |||
253 | /** |
||
254 | * @return BufferInterface |
||
255 | */ |
||
256 | 315 | public function getBuffer() |
|
260 | |||
261 | /** |
||
262 | * @return BufferInterface |
||
263 | */ |
||
264 | 54 | public function getWitnessBuffer() |
|
268 | } |
||
269 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: