Fix loading of config options as env vars

This commit is contained in:
Alejandro Celaya
2022-08-08 19:23:16 +02:00
parent 6378e614b0
commit a2f9742cfc
3 changed files with 19 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Config;
use function Functional\map;
use function Shlinkio\Shlink\Config\env;
enum EnvVars: string
@@ -74,4 +75,13 @@ enum EnvVars: string
{
return $this->loadFromEnv() !== null;
}
/**
* @return string[]
*/
public static function values(): array
{
static $values;
return $values ?? ($values = map(self::cases(), static fn (EnvVars $envVar) => $envVar->value));
}
}