diff --git a/composer.json b/composer.json index 8566e18..feaee42 100644 --- a/composer.json +++ b/composer.json @@ -13,5 +13,8 @@ "psr-4": { "NoccyLabs\\Juicer\\": "src/" } + }, + "require": { + "php": "~7.0" } -} \ No newline at end of file +} diff --git a/src/Recipe/Mixer/MeasuredRecipe.php b/src/Recipe/Mixer/MeasuredRecipe.php deleted file mode 100644 index e74221c..0000000 --- a/src/Recipe/Mixer/MeasuredRecipe.php +++ /dev/null @@ -1,31 +0,0 @@ -recipe = $recipe; + $this->mixedIngredients = $mixedIngredients; + } + + public function getIngredients(): array + { + return $this->recipe->getIngredients(); + } + + public function getMeasuredIngredients(): array + { + return $this->mixedIngredients; + } + + public function getTotalFlavorMl(): float + { + + } + + public function getTotalFlavorPercent(): float + { + + } + + public function getTotalFlavorGrams(): float + { + + } + + public function getSpecificGravity(): float + { + + } +} \ No newline at end of file diff --git a/src/Recipe/Mixer/Mixer.php b/src/Recipe/Mixer/Mixer.php index f833b07..4157ef6 100644 --- a/src/Recipe/Mixer/Mixer.php +++ b/src/Recipe/Mixer/Mixer.php @@ -10,7 +10,7 @@ use NoccyLabs\Juicer\Ingredient\NicotineBase; class Mixer { - public function mixRecipe(RecipeInterface $recipe, int $volume, Base $base, int $nicotineStrength, ?NicotineBase $nicotineBase=null) + public function mixRecipe(RecipeInterface $recipe, int $volume, Base $base, int $nicotineStrength, ?NicotineBase $nicotineBase=null): MixedRecipe { // Array holding our final list $mixed = []; @@ -55,7 +55,8 @@ class Mixer $mixed[] = new MeasuredIngredient($ingredient, $ingredientPercent, $volume * $floatPercent); } - return $mixed; + $mixedRecipe = new MixedRecipe($recipe, $mixed); + return $mixedRecipe; } } \ No newline at end of file diff --git a/tests/Recipe/Mixer/MixerTest.php b/tests/Recipe/Mixer/MixerTest.php index 81678a9..3a97f6d 100644 --- a/tests/Recipe/Mixer/MixerTest.php +++ b/tests/Recipe/Mixer/MixerTest.php @@ -29,7 +29,7 @@ class MixerTest extends \PhpUnit\Framework\TestCase $mixer = new Mixer(); $base = new Base($base); - $mixed = $mixer->mixRecipe($recipe, $amount, $base, 0); + $mixed = $mixer->mixRecipe($recipe, $amount, $base, 0)->getMeasuredIngredients(); $this->assertCount(count($assertBases), $mixed); $mixedAmount = 0; @@ -63,7 +63,7 @@ class MixerTest extends \PhpUnit\Framework\TestCase { $mixer = new Mixer(); $base = new Base($base); - $mixed = $mixer->mixRecipe($recipe, $amount, $base, 0); + $mixed = $mixer->mixRecipe($recipe, $amount, $base, 0)->getMeasuredIngredients(); $expectedCount = count($base->getComponents()) + count($recipe->getIngredients());