Skip to content

Commit

Permalink
Merge pull request #1094 from Hlavtox/php-84
Browse files Browse the repository at this point in the history
Fix PHP 8.4 compatibility
  • Loading branch information
Hlavtox authored Nov 29, 2024
2 parents 1872d56 + 7d982c7 commit 79d694e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Hook/ProductSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PrestaShop\Module\FacetedSearch\Filters\Converter;
use PrestaShop\Module\FacetedSearch\Filters\DataAccessor;
use PrestaShop\Module\FacetedSearch\Filters\Provider;
use PrestaShop\Module\FacetedSearch\Product\SearchFactory;
use PrestaShop\Module\FacetedSearch\Product\SearchProvider;
use PrestaShop\Module\FacetedSearch\URLSerializer;
use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery;
Expand Down Expand Up @@ -110,7 +111,7 @@ public function productSearchProvider(array $params)
),
$urlSerializer,
$dataAccessor,
null,
new SearchFactory(),
$provider
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Product/SearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public function __construct(
Filters\Converter $converter,
URLSerializer $serializer,
Filters\DataAccessor $dataAccessor,
SearchFactory $searchFactory = null,
SearchFactory $searchFactory,
Filters\Provider $provider
) {
$this->module = $module;
$this->filtersConverter = $converter;
$this->urlSerializer = $serializer;
$this->dataAccessor = $dataAccessor;
$this->searchFactory = $searchFactory === null ? new SearchFactory() : $searchFactory;
$this->searchFactory = $searchFactory;
$this->provider = $provider;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/php/FacetedSearch/Product/SearchProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use PrestaShop\Module\FacetedSearch\Filters\Converter;
use PrestaShop\Module\FacetedSearch\Filters\DataAccessor;
use PrestaShop\Module\FacetedSearch\Filters\Provider;
use PrestaShop\Module\FacetedSearch\Product\SearchFactory;
use PrestaShop\Module\FacetedSearch\Product\SearchProvider;
use PrestaShop\Module\FacetedSearch\URLSerializer;
use PrestaShop\PrestaShop\Core\Product\Search\Facet;
Expand Down Expand Up @@ -149,7 +150,7 @@ protected function setUp()
$this->converter,
$this->serializer,
new DataAccessor($this->database),
null,
new SearchFactory(),
new Provider($this->database)
);
}
Expand Down

0 comments on commit 79d694e

Please sign in to comment.