Skip to content

Commit 28bd665

Browse files
committed
Update Config.php
1 parent d42c15d commit 28bd665

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Config.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ public static function get(string $key, $default = null) {
5252
* @return array<string, mixed>
5353
*/
5454
private static function getEnvConfig(array $config): array {
55-
$vars = preg_grep('/^PCA_/', array_keys(getenv()));
56-
57-
if ($vars !== false && count($vars)) {
58-
foreach ($vars as $var) {
59-
self::envVarToArray($config, $var, (string) getenv($var));
55+
foreach (getenv() as $var => $value) {
56+
if (str_starts_with($var, 'PCA_')) {
57+
self::envVarToArray($config, $var, $value);
6058
}
6159
}
6260

0 commit comments

Comments
 (0)