1 | <?php |
||
26 | final class Config |
||
27 | { |
||
28 | /** |
||
29 | * Path to package composer.json |
||
30 | * |
||
31 | * @var string|null |
||
32 | */ |
||
33 | private $config_path; |
||
34 | |||
35 | /** |
||
36 | * Array with contents of composer.json |
||
37 | * |
||
38 | * @var array|null |
||
39 | */ |
||
40 | private $config_data; |
||
41 | |||
42 | /** |
||
43 | * Config arguments starting with (aframe-) |
||
44 | * |
||
45 | * @var array|null |
||
46 | */ |
||
47 | private $config_args; |
||
48 | |||
49 | /** |
||
50 | * Useful config vars |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | private $config_vars; |
||
55 | |||
56 | /** |
||
57 | * Configuration constructor |
||
58 | * |
||
59 | * @return void |
||
|
|||
60 | */ |
||
61 | 62 | public function __construct() |
|
66 | |||
67 | /** |
||
68 | * Get configuration value by key |
||
69 | * |
||
70 | * @param string $prop |
||
71 | * @return string|null |
||
72 | */ |
||
73 | 59 | public function get(string $prop) |
|
77 | |||
78 | /** |
||
79 | * Real path to aframe-php composer.json |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 62 | protected function getConfigRealPath() |
|
87 | |||
88 | /** |
||
89 | * Whether config file can be found |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 62 | protected function configExists() |
|
97 | |||
98 | /** |
||
99 | * Load contents of aframe-php cmposer.json |
||
100 | * |
||
101 | * @return array|null |
||
102 | */ |
||
103 | 62 | protected function loadComposerJson() |
|
107 | |||
108 | /** |
||
109 | * Define Configuration constants |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | 62 | protected function defineVars() |
|
120 | } |
||
121 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.