public function setIngredient($key, Item $item) { if (!array_key_exists($key, $this->shape)) { throw new \Exception("Symbol does not appear in the shape: " . $key); } $this->fixRecipe($key, $item); return $this; }