From 79ae47217171c655c2e7ca0989a27cd879e6ed7f Mon Sep 17 00:00:00 2001 From: Freek van Rijt Date: Mon, 21 Oct 2024 16:16:49 +0200 Subject: [PATCH] fix: fix error on install due to usage of `use` in factory closure fixes an error on install with recent prestashop releases caused by the `psVersionFactory` Fixes #281, Closes INT-695 --- src/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions.php b/src/functions.php index 0def6bcd..0b979e3d 100644 --- a/src/functions.php +++ b/src/functions.php @@ -52,7 +52,7 @@ function bootPdk( */ function psVersionFactory(array $entries): FactoryDefinitionHelper { - return factory(function () use ($entries) { + return factory(function (array $entries) { $psVersion = PdkFacade::get('ps.version'); $fallback = Arr::first($entries, static function ($entry) { return ! isset($entry['version']); @@ -71,5 +71,5 @@ function psVersionFactory(array $entries): FactoryDefinitionHelper } return PdkFacade::get($fallback['class']); - }); + })->parameter('entries', $entries); }