sodiumVault = $sodiumVault; $this->dotenvVault = $dotenvVault; } public function getSecret(string $key): string { $secret = null; if (array_key_exists($key, $this->dotenvVault->list(false))) { $secret = $this->dotenvVault->reveal($key); } if ($secret) { return $secret; } $secret = $this->sodiumVault->reveal($key); if ($secret) { return $secret; } else { throw new \RuntimeException("Secret '{$key}' does not exist!"); } } }