flavoringName, $data->brandKey); print_r($data); return $ingredient; } /** * Import ingredient from json contained in a file * * @param string The filename to read and import * @return IngredientInterface */ public function readFromFile(string $filename): IngredientInterface { $fd = fopen($filename, "r"); if (!$fd) { throw new \InvalidArgumentException(); } $json = fread($fd, filesize($filename)); fclose($fd); return $this->import($json); } }