Skip to content

Commit eef1364

Browse files
authored
ENGCOM-6839: Code hygeine in bundle option graphql resolver #26781
2 parents 5e86f23 + 955c4ba commit eef1364

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ public function addParentFilterData(int $parentId, int $parentEntityId, string $
7878
public function getOptionsByParentId(int $parentId) : array
7979
{
8080
$options = $this->fetch();
81-
if (!isset($options[$parentId])) {
82-
return [];
83-
}
84-
85-
return $options[$parentId];
81+
return $options[$parentId] ?? [];
8682
}
8783

8884
/**
@@ -115,7 +111,7 @@ private function fetch() : array
115111

116112
$this->extensionAttributesJoinProcessor->process($optionsCollection);
117113
if (empty($optionsCollection->getData())) {
118-
return null;
114+
return [];
119115
}
120116

121117
/** @var \Magento\Bundle\Model\Option $option */

0 commit comments

Comments
 (0)