From 3ca0f35cb719a6a9b968adb23821501236efe82d Mon Sep 17 00:00:00 2001 From: Hugo Cox Date: Tue, 17 Jun 2025 09:41:08 +0200 Subject: [PATCH] (chore): add support for DEEPL_API_URL environment variable in DeeplClient --- src/Clients/DeeplClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Clients/DeeplClient.php b/src/Clients/DeeplClient.php index 143e746..f2a1ad9 100644 --- a/src/Clients/DeeplClient.php +++ b/src/Clients/DeeplClient.php @@ -12,6 +12,10 @@ class DeeplClient public function __construct( string $apiKey ) { $this->apiKey = $apiKey; + $envUrl = trim((string) getenv('DEEPL_API_URL')); + if ($envUrl !== '') { + $this->baseUrl = rtrim($envUrl, '/'); + } } /**