From f627051ee5b2607e5d7cbb384d0e53a7697060b5 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Thu, 7 Nov 2024 13:50:33 +0100 Subject: [PATCH] Fix regression from #875 (#910) * Fix regression from #875 * getValueForObject/getValueFromObjectBrick returns mixed * setValue return mixed --- src/GraphQL/Service.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/GraphQL/Service.php b/src/GraphQL/Service.php index ae90ff98..0bc0b5c0 100644 --- a/src/GraphQL/Service.php +++ b/src/GraphQL/Service.php @@ -53,7 +53,6 @@ use Pimcore\Model\Factory; use Pimcore\Translation\Translator; use Psr\Container\ContainerInterface; -use stdClass; class Service { @@ -782,8 +781,11 @@ public function getPropertyTypeDefinition($typeName) * @param string|null $brickType * @param string|null $brickKey * @param Data|null $fieldDefinition + * @param array $context + * @param array|null $brickDescriptor + * @param array $args * - * @return stdclass, value and objectid where the value comes from + * @return mixed */ public static function getValueForObject($object, $key, $brickType = null, $brickKey = null, $fieldDefinition = null, $context = [], $brickDescriptor = null, $args = []) { @@ -838,7 +840,7 @@ public static function getValueForObject($object, $key, $brickType = null, $bric * @param string $attribute * @param \Closure $callback * - * @return stdclass|null + * @return mixed result of the callback * * @throws \Exception */ @@ -1162,9 +1164,9 @@ public static function getValueFromObjectBrick( Concrete $object, string $brickType, string $brickKey, - string $brickDescriptor = null, + ?array $brickDescriptor = null, array $descriptorData = [], - ): stdClass|array|null { + ): mixed { $context = ['object' => $object]; $key = \Pimcore\Model\DataObject\Service::getFieldForBrickType($object->getclass(), $brickType); @@ -1188,7 +1190,8 @@ public static function getValueFromObjectBrick( $def, $context, $brickDescriptor, - $descriptorData['args'] ?? []); + $descriptorData['args'] ?? [] + ); } return null;