Skip to content

Commit

Permalink
chore: code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
benborla committed Nov 17, 2023
1 parent 866a253 commit c155c4e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions api/src/Service/FruitAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ public function sync(): self
$isNew = true;
}

$fruit->setName($item['name'])
->setFamily($item['family'])
->setFruitOrder($item['order'])
->setGenus($item['genus'])
->setCalories($item['nutritions']['calories'])
->setFat($item['nutritions']['fat'])
->setSugar($item['nutritions']['sugar'])
->setCarbohydrates($item['nutritions']['carbohydrates'])
->setProtein($item['nutritions']['protein'])
$fruit->setName($item['name'] ?? '')
->setFamily($item['family'] ?? '')
->setFruitOrder($item['order'] ?? '')
->setGenus($item['genus'] ?? '')
->setCalories($item['nutritions']['calories'] ?? 0.0)
->setFat($item['nutritions']['fat'] ?? 0.0)
->setSugar($item['nutritions']['sugar'] ?? 0.0)
->setCarbohydrates($item['nutritions']['carbohydrates'] ?? 0.0)
->setProtein($item['nutritions']['protein'] ?? 0.0)
->setSource(Fruit::SOURCE_FETCHED_API);

// @INFO: Persist non-existent data
Expand Down

0 comments on commit c155c4e

Please sign in to comment.