php-juicer/src/Recipe/Mixer/Mixer.php

31 lines
867 B
PHP

<?php
namespace NoccyLabs\Juicer\Recipe\Mixer;
use NoccyLabs\Juicer\Ingredient\IngredientInterface;
use NoccyLabs\Juicer\Recipe\RecipeInterface;
use NoccyLabs\Juicer\Ingredient\Base;
use NoccyLabs\Juicer\Ingredient\NicotineBase;
class Mixer
{
public function mixRecipe(RecipeInterface $recipe, int $volume, Base $base, int $nicotineStrength, ?NicotineBase $nicotineBase=null)
{
$mixed = [];
$components = $base->getComponents();
if (array_key_exists('VG', $components) && $components['VG'] > 0) {
$mixed[] = new MeasuredIngredient("VG", null, "VG100", Base::MASS_VG, 100, $volume);
}
if (array_key_exists('PG', $components) && $components['PG'] > 0) {
$mixed[] = new MeasuredIngredient("PG", null, "PG100", Base::MASS_PG, 100, $volume);
}
return $mixed;
}
}