getSpecificGravity(); $this->name = $ingredient->getFlavorName(); $this->brand = $ingredient->getFlavorBrand(); $this->base = $base??$ingredient->getBase(); } else { $asg = null; $this->name = $ingredient; $this->base = $base??"PG100"; } if (!$asg) { $base = new Base($this->base); $asg = $base->getSpecificGravity(); } $this->asg = $asg; $this->percent = $percent; $this->volume = $volume; $this->weight = $volume * $asg; } /** * * @return string */ public function getFlavorName(): string { return $this->name; } /** * * @return string|null */ public function getFlavorBrand(): ?string { return $this->brand; } /** * * @return string|null */ public function getBase(): ?string { return $this->base; } /** * * @return float */ public function getPercent(): float { return $this->percent; } /** * * @return float */ public function getSpecificGravity(): float { return $this->asg; } /** * * @return float */ public function getVolume(): float { return $this->volume; } /** * * @return float */ public function getWeight(): float { return $this->weight; } }