Initial checkin
This commit is contained in:
31
src/Recipe/Mixer/Mixer.php
Normal file
31
src/Recipe/Mixer/Mixer.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user