Created
June 4, 2020 02:29
-
-
Save anvodev/35658ea5b5f7e90b8ff99724427ba3ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//coffee_shop_rainy_day_context.php | |
//to load Class & Interface file when we need them | |
spl_autoload_register(function ($class_name) { | |
include $class_name . '.php'; | |
}); | |
//at the coffee shop in a rainy day | |
$egg = new Egg(); | |
$coffee = new EggCoffee($egg); | |
$sweeterCoffee = new SweeterCoffee($coffee); | |
$consumer = new AtCoffeeShopConsumer($sweeterCoffee); | |
$consumer->readyToWork(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment