From 08a3025143657a38b05cbb4970b611efc3aa51ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Sun, 19 Nov 2023 14:59:18 +0100 Subject: [PATCH] Code optimization [skip ci] --- src/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index 81dc187..4bd3208 100644 --- a/src/Client.php +++ b/src/Client.php @@ -29,10 +29,10 @@ final class Client { * @param string $apiKey The Free Mobile API key. * @param string $baseUrl The base URL of the remote API endpoint. */ - function __construct(string $account, string $apiKey, string $baseUrl = "https://smsapi.free-mobile.fr/") { + function __construct(string $account, string $apiKey, string $baseUrl = "https://smsapi.free-mobile.fr") { $this->account = $account; $this->apiKey = $apiKey; - $this->baseUrl = new Uri($baseUrl); + $this->baseUrl = new Uri(mb_substr($baseUrl, -1) == "/" ? $baseUrl : "$baseUrl/"); } /**