diff --git a/src/LazySecretsLoader.php b/src/LazySecretsLoader.php index cc3f2b42a..5e91e358e 100644 --- a/src/LazySecretsLoader.php +++ b/src/LazySecretsLoader.php @@ -19,6 +19,11 @@ final class LazySecretsLoader { public static function loadSecretEnvironmentVariables(): void { + + if (class_exists(Secrets::class)) { + Secrets::loadSecretEnvironmentVariables(); + } + if (! self::areThereSecretsToLoad()) { return; } @@ -27,7 +32,6 @@ public static function loadSecretEnvironmentVariables(): void throw new Exception('The "bref/secrets-loader" package is required to load SSM parameters via the "bref-ssm:xxx" syntax in environment variables. Please add it to your "require" section in composer.json.'); } - Secrets::loadSecretEnvironmentVariables(); } /**