1 | <?php declare(strict_types=1); |
||
13 | class ConfigBuilder |
||
14 | { |
||
15 | const DEFAULT_ENV = '##default##'; |
||
16 | |||
17 | private $header = ''; |
||
18 | |||
19 | private $environments = []; |
||
20 | |||
21 | /** |
||
22 | * @var string|null |
||
23 | */ |
||
24 | private $currentEnvironment; |
||
25 | |||
26 | private $currentCommandPaths; |
||
27 | |||
28 | private $currentDotenvPaths; |
||
29 | |||
30 | private $currentDynamicVariables; |
||
31 | |||
32 | private $templates; |
||
33 | |||
34 | private $currentConstants; |
||
35 | |||
36 | private $hidden; |
||
37 | |||
38 | private $currentRequiredVariables; |
||
39 | |||
40 | private $imports; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $workingDirectory; |
||
46 | |||
47 | public function setHeader(?string $header = null): ConfigBuilder |
||
53 | |||
54 | public function setWorkingDirectory(string $workingDirectory): ConfigBuilder |
||
60 | |||
61 | public function start(?string $environment = null): ConfigBuilder |
||
72 | |||
73 | public function setHidden(bool $set): ConfigBuilder |
||
79 | |||
80 | public function setCommandPaths(array $commandPaths): ConfigBuilder |
||
96 | |||
97 | /** |
||
98 | * @deprecated only used by yaml builder |
||
99 | */ |
||
100 | public function setDotenvPaths(array $dotenvPaths): ConfigBuilder |
||
110 | |||
111 | public function addDotenvPath(string $dotenvPath): ConfigBuilder |
||
117 | |||
118 | public function addRequirePlaceholder(string $name, ?string $description = null): ConfigBuilder |
||
124 | |||
125 | /** |
||
126 | * @deprecated only used by yaml builder |
||
127 | */ |
||
128 | public function setDynamicVariables(array $dynamicVariables): ConfigBuilder |
||
134 | |||
135 | public function addDynamicVariable(string $key, string $value): ConfigBuilder |
||
141 | |||
142 | /** |
||
143 | * @deprecated only used by yaml builder |
||
144 | */ |
||
145 | public function setConstants(array $constants): ConfigBuilder |
||
151 | |||
152 | public function addConstVariable(string $key, string $value): ConfigBuilder |
||
158 | |||
159 | public function addImport(string $path): self |
||
165 | |||
166 | public function setTemplates(array $templates, string $baseFile): ConfigBuilder |
||
176 | |||
177 | public function create(RuntimeParameters $runtimeParameters): Config |
||
183 | |||
184 | private function reset(): void |
||
208 | } |
||
209 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: