Skip to content

Commit

Permalink
fix: remove deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit382 committed Jan 23, 2025
1 parent 1fb10ec commit b92dcc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OpenFoodFacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function barcode(string $value): array
try {
$doc = $this->api->getProduct($value);

return empty($doc->code) ? [] : (array) reset($doc);
return empty($doc->code) ? [] : $doc->getData();
} catch (ProductNotFoundException) {
return [];
}
Expand Down

0 comments on commit b92dcc1

Please sign in to comment.