Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
wthijmen authored and EdieLemoine committed Mar 6, 2024
1 parent ba61884 commit a42c7e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"type": "prestashop-module",
"require": {
"myparcelnl/pdk": "2.32.0",
"myparcelnl/pdk": "^2.0.0",
"php": ">=7.4.0"
},
"require-dev": {
Expand Down
21 changes: 11 additions & 10 deletions config/pdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@
use function DI\get;
use function DI\value;

$comparePsVersion = '1.8.0';
$currentPsVersion = constant('_PS_VERSION_');

if (version_compare($currentPsVersion, $comparePsVersion, '<')) {
$guzzleAdapter = Guzzle5ClientAdapter::class;
} else {
$guzzleAdapter = Guzzle7ClientAdapter::class;
}

return [
'defaultCutoffTime' => value('17:00'),
'defaultCutoffTimeSameDay' => value('10:00'),
Expand Down Expand Up @@ -162,7 +153,17 @@
/**
* Miscellaneous
*/
ClientAdapterInterface::class => get($guzzleAdapter),
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);
}),

LoggerInterface::class => get(PsLogger::class),
MigrationServiceInterface::class => get(PsMigrationService::class),
ScriptServiceInterface::class => get(PsScriptService::class),
Expand Down

0 comments on commit a42c7e5

Please sign in to comment.