From f3a586870c7c8c9dc510645e8b195a5d04e4e606 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Fri, 8 Jun 2018 22:12:22 +0200 Subject: [PATCH] Allow description to be null --- src/Hydrator/Strategy/WebEntitiesStrategy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Hydrator/Strategy/WebEntitiesStrategy.php b/src/Hydrator/Strategy/WebEntitiesStrategy.php index 13dfa7d..23c49d8 100644 --- a/src/Hydrator/Strategy/WebEntitiesStrategy.php +++ b/src/Hydrator/Strategy/WebEntitiesStrategy.php @@ -32,7 +32,11 @@ public function hydrate($value) $webEntities = []; foreach ($value as $webEntityInfo) { - $webEntities[] = new WebEntity($webEntityInfo['entityId'], $webEntityInfo['description'], isset($webEntityInfo['score']) ? $webEntityInfo['score'] : null); + $webEntities[] = new WebEntity( + $webEntityInfo['entityId'], + isset($webEntityInfo['description']) ? $webEntityInfo['description'] : null, + isset($webEntityInfo['score']) ? $webEntityInfo['score'] : null + ); } return $webEntities;