Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
25 | abstract class Config |
||
26 | { |
||
27 | /** |
||
28 | * The model properties env keys. |
||
29 | * |
||
30 | * @var array<string, string> |
||
31 | */ |
||
32 | protected static array $envNames = []; |
||
33 | |||
34 | /** |
||
35 | * Create config from Env. |
||
36 | * |
||
37 | * @param class-string $env The env |
||
|
|||
38 | */ |
||
39 | public static function fromEnv(string $env): static |
||
40 | { |
||
41 | $new = new static(); |
||
42 | |||
43 | $new->setPropertiesFromEnv($env); |
||
44 | |||
45 | return $new; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Set properties from env. |
||
50 | * |
||
51 | * @param class-string $env The env |
||
52 | */ |
||
53 | public function setPropertiesFromEnv(string $env): void |
||
68 | } |
||
69 | } |
||
72 |