Skip to content

Commit 955c4ba

Browse files
ENGCOM-6839: Code hygeine in bundle option graphql resolver #26781
- Merge Pull Request #26781 from moloughlin/magento2:fix/bundle_option_graphql_return_type - Merged commits: 1. 9e789ca 2. 4238f7b
2 parents 15b5c60 + 4238f7b commit 955c4ba

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)