Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CoffeeMaker
- {
- private $grinder;
- private $steeper;
- private $water;
- private $pullLever;
- public function __construct(Grinder $grinder, Steeper $steeper, Water $water, Lever $pullLever)
- {
- $this->grinder = $grinder;
- $this->steeper = $steeper;
- $this->water = $water;
- $this->pullLever = $pullLever;
- }
- public function makeAmericano($beans)
- {
- return $this->steeper->steep($this->water, $this->grinder->grind($beans)));
- }
- public function makeEspresso($beans)
- {
- return $this->pullLever->pull($this->grinder->grind($beans));
- }
- }
Add Comment
Please, Sign In to add comment