From 2a65ae34bc7fcbb02711a49100a1179c3c02e409 Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Thu, 14 Mar 2024 16:41:45 +0100 Subject: [PATCH] fix(install): fix error on install --- config/pdk.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/config/pdk.php b/config/pdk.php index ab7e63e9..7fc17238 100644 --- a/config/pdk.php +++ b/config/pdk.php @@ -154,19 +154,12 @@ * Miscellaneous */ ClientAdapterInterface::class => factory(function () { - $comparePsVersion = '1.8.0'; - $currentPsVersion = constant('_PS_VERSION_'); - - if (version_compare($currentPsVersion, $comparePsVersion, '<')) { - return get(Guzzle5ClientAdapter::class); - } - - return get(Guzzle7ClientAdapter::class); + return _PS_VERSION_ >= 8 ? Pdk::get(Guzzle7ClientAdapter::class) : Pdk::get(Guzzle5ClientAdapter::class); }), - LoggerInterface::class => get(PsLogger::class), - MigrationServiceInterface::class => get(PsMigrationService::class), - ScriptServiceInterface::class => get(PsScriptService::class), + LoggerInterface::class => get(PsLogger::class), + MigrationServiceInterface::class => get(PsMigrationService::class), + ScriptServiceInterface::class => get(PsScriptService::class), InstallerServiceInterface::class => factory(function () { /** @var \MyParcelNL\PrestaShop\Pdk\Installer\Service\PsPreInstallService $preInstallService */