1 | <?php |
||
9 | class RegtestBitcoinFactory |
||
10 | { |
||
11 | const TESTS_DIR = "BITCOIND_TEST_DIR"; |
||
12 | const BITCOIND = "BITCOIND_PATH"; |
||
13 | |||
14 | /** |
||
15 | * @var array|false|null|string |
||
16 | */ |
||
17 | private $testsDirPath; |
||
18 | |||
19 | /** |
||
20 | * @var array|false|null|string |
||
21 | */ |
||
22 | private $bitcoindPath; |
||
23 | |||
24 | /** |
||
25 | * @var string[] |
||
26 | */ |
||
27 | private $testDir = []; |
||
28 | |||
29 | /** |
||
30 | * @var RpcServer[] |
||
31 | */ |
||
32 | private $server = []; |
||
33 | |||
34 | public function __construct() { |
||
40 | |||
41 | private function envOrDefault($var, $default = null) { |
||
48 | |||
49 | protected function createRandomTestDir() { |
||
56 | |||
57 | public function startBitcoind() { |
||
64 | |||
65 | protected function cleanup() { |
||
77 | |||
78 | public function __destruct() |
||
82 | } |
||
83 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: