From 05877c880420019ff0217af4d8e88de258f8a29c Mon Sep 17 00:00:00 2001 From: Martin Eiber Date: Mon, 29 Jan 2024 11:29:35 +0100 Subject: [PATCH] PD-115 Fix PHPStan (#4) * PD-115 Fix PHPStan * PD-105 Update composer dependencies. * PD-105 Update composer description. * PD-105 Removed unused autoload. * PD-105 Require symfony/messenger 6.4 --- composer.json | 10 +++++----- .../SearchIndex/OpenSearch/OpenSearchService.php | 2 +- src/Service/SearchIndex/OpenSearch/PathService.php | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 44688a04..965d5dd8 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "pimcore/generic-data-index-bundle", "license": "Pimcore Enterprise License (PEL)", "type": "pimcore-bundle", - "description": "Pimcore xTemplate Bundlex", + "description": "Pimcore Generic data index Bundle", "config": { "discard-changes": true, "sort-packages": true, @@ -19,10 +19,11 @@ "require": { "php": "~8.1.0 || ~8.2.0", "pimcore/enterprise-subscription-tools": "^1.3", - "pimcore/pimcore": "^11.0", + "pimcore/pimcore": "^11.1", "opensearch-project/opensearch-php": "^2.2.0", "doctrine/orm": "^2.17.2", - "symfony/scheduler": "^6.3|^7.0" + "symfony/scheduler": "^6.4", + "symfony/messenger": "^6.4" }, "require-dev": { "roave/security-advisories": "dev-latest", @@ -40,8 +41,7 @@ }, "autoload": { "psr-4": { - "Pimcore\\Bundle\\GenericDataIndexBundle\\": "src/", - "Pimcore\\": "core-extension/Pimcore/" + "Pimcore\\Bundle\\GenericDataIndexBundle\\": "src/" } }, "autoload-dev": { diff --git a/src/Service/SearchIndex/OpenSearch/OpenSearchService.php b/src/Service/SearchIndex/OpenSearch/OpenSearchService.php index 758eca13..1dda8dff 100644 --- a/src/Service/SearchIndex/OpenSearch/OpenSearchService.php +++ b/src/Service/SearchIndex/OpenSearch/OpenSearchService.php @@ -226,7 +226,7 @@ public function putMapping(array $params): array public function countByAttributeValue(string $indexName, string $attribute, string $value): int { - $this->openSearchClient->search([ + $countResult = $this->openSearchClient->search([ 'index' => $indexName, 'track_total_hits' => true, 'rest_total_hits_as_int' => true, diff --git a/src/Service/SearchIndex/OpenSearch/PathService.php b/src/Service/SearchIndex/OpenSearch/PathService.php index 57b0dec8..c266d2f8 100644 --- a/src/Service/SearchIndex/OpenSearch/PathService.php +++ b/src/Service/SearchIndex/OpenSearch/PathService.php @@ -34,7 +34,8 @@ public function __construct( } /** - * Directly update children paths in OpenSearch for assets as otherwise you might get strange results if you rename a folder in the portal engine frontend. + * Directly update children paths in OpenSearch for assets as otherwise you might get strange results + * if you rename a folder in the portal engine frontend. * * @throws Exception */ @@ -134,7 +135,7 @@ private function updatePath(string $indexName, string $currentPath, string $newP private function countDocumentsByPath(string $indexName, string $path): int { - $this->openSearchClient->search([ + $countResult = $this->openSearchClient->search([ 'index' => $indexName, 'track_total_hits' => true, 'rest_total_hits_as_int' => true,