From fea78a8513376824bd35f352d06c0c101e27f8eb Mon Sep 17 00:00:00 2001 From: Mauricio Astudillo Toledo Date: Tue, 10 Sep 2024 17:45:00 -0300 Subject: [PATCH] factor: remove empty catch block --- src/Utils/HttpClient.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Utils/HttpClient.php b/src/Utils/HttpClient.php index a284d220..490e1795 100644 --- a/src/Utils/HttpClient.php +++ b/src/Utils/HttpClient.php @@ -30,11 +30,8 @@ public function request( ): ResponseInterface { $installedVersion = 'unknown'; - if (class_exists('\Composer\InstalledVersions')) { - try { - $installedVersion = InstalledVersions::getVersion('transbank/transbank-sdk'); - } catch (\Exception $e) { - } + if (class_exists('\Composer\InstalledVersions') && InstalledVersions::isInstalled('transbank/transbank-sdk')) { + $installedVersion = InstalledVersions::getVersion('transbank/transbank-sdk') ?? 'unknown'; } $baseHeaders = [