Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
53 | public function setPropertiesFromEnv(string $env): void |
||
54 | { |
||
55 | foreach (static::$envNames as $propertyName => $envName) { |
||
56 | if (defined("$env::$envName")) { |
||
57 | $constantValue = constant("$env::$envName"); |
||
58 | |||
59 | if (is_callable($constantValue)) { |
||
60 | $this->$propertyName = $constantValue() |
||
61 | ?? $this->$propertyName; |
||
62 | |||
63 | continue; |
||
64 | } |
||
65 | |||
66 | $this->$propertyName = $constantValue |
||
67 | ?? $this->$propertyName; |
||
68 | } |
||
72 |