| 1 | <?php |
||
| 9 | class UTXO { |
||
| 10 | |||
| 11 | public $hash; |
||
| 12 | public $index; |
||
| 13 | public $value; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var AddressInterface |
||
| 17 | */ |
||
| 18 | public $address; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var ScriptInterface |
||
| 22 | */ |
||
| 23 | public $scriptPubKey; |
||
| 24 | public $path; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var ScriptInterface |
||
| 28 | */ |
||
| 29 | public $redeemScript; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var ScriptInterface|null |
||
| 33 | */ |
||
| 34 | public $witnessScript; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | public $signMode; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * UTXO constructor. |
||
| 43 | * @param $hash |
||
| 44 | * @param $index |
||
| 45 | * @param null $value |
||
| 46 | * @param AddressInterface|null $address |
||
| 47 | * @param ScriptInterface|null $scriptPubKey |
||
| 48 | * @param null $path |
||
| 49 | * @param ScriptInterface|null $redeemScript |
||
| 50 | * @param ScriptInterface|null $witnessScript |
||
| 51 | * @param string $signMode |
||
| 52 | */ |
||
| 53 | public function __construct( |
||
| 54 | $hash, |
||
| 55 | $index, |
||
| 56 | $value = null, |
||
| 57 | AddressInterface $address = null, |
||
| 58 | ScriptInterface $scriptPubKey = null, |
||
| 59 | $path = null, |
||
| 60 | ScriptInterface $redeemScript = null, |
||
| 61 | ScriptInterface $witnessScript = null, |
||
| 62 | $signMode = SignInfo::MODE_SIGN |
||
| 63 | ) { |
||
| 64 | $this->hash = $hash; |
||
| 65 | $this->index = $index; |
||
| 66 | $this->value = $value; |
||
| 67 | $this->address = $address; |
||
| 68 | $this->scriptPubKey = $scriptPubKey; |
||
| 69 | $this->path = $path; |
||
| 70 | $this->redeemScript = $redeemScript; |
||
| 71 | $this->witnessScript = $witnessScript; |
||
| 72 | $this->signMode = $signMode; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return SignInfo |
||
| 77 | */ |
||
| 78 | public function getSignInfo() { |
||
| 81 | } |
||
| 82 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.