1 | <?php |
||
7 | class WitnessScript extends Script |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var ScriptInterface |
||
12 | */ |
||
13 | private $outputScript; |
||
14 | |||
15 | /** |
||
16 | * @var WitnessProgram|null |
||
17 | */ |
||
18 | private $witnessProgram; |
||
19 | |||
20 | /** |
||
21 | * WitnessScript constructor. |
||
22 | * @param ScriptInterface $script |
||
23 | * @param Opcodes|null $opcodes |
||
24 | * @throws WitnessScriptException |
||
25 | */ |
||
26 | 8 | public function __construct(ScriptInterface $script, Opcodes $opcodes = null) |
|
39 | |||
40 | /** |
||
41 | * @return WitnessProgram |
||
42 | */ |
||
43 | 6 | public function getWitnessProgram() |
|
51 | |||
52 | /** |
||
53 | * @return ScriptInterface |
||
54 | */ |
||
55 | 6 | public function getOutputScript() |
|
59 | } |
||
60 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: