From 4092f939d83738848af967ce4504547111120f33 Mon Sep 17 00:00:00 2001 From: Thorsten Reiter Date: Wed, 5 Jun 2024 10:24:27 +0200 Subject: [PATCH] declare as array --- phpstan-baseline.neon | 5 ----- src/lib/Service/ContentService.php | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2611060a..f16c7e02 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -875,11 +875,6 @@ parameters: count: 1 path: src/lib/Service/ContentService.php - - - message: "#^Method EzSystems\\\\EzRecommendationClient\\\\Service\\\\ContentService\\:\\:prepareFields\\(\\) should return array\\ but returns array\\, mixed\\>\\|null\\.$#" - count: 1 - path: src/lib/Service/ContentService.php - - message: "#^Method EzSystems\\\\EzRecommendationClient\\\\Service\\\\ContentService\\:\\:setContent\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/src/lib/Service/ContentService.php b/src/lib/Service/ContentService.php index b41be9b2..1f2d770c 100644 --- a/src/lib/Service/ContentService.php +++ b/src/lib/Service/ContentService.php @@ -265,6 +265,7 @@ private function prepareFields(APIContentType $contentType, ?array $fields = nul return $fields; } + $fields = []; foreach ($contentType->getFieldDefinitions() as $field) { $fields[] = $field->identifier; }