Skip to content

Instantly share code, notes, and snippets.

@anvodev
Created June 4, 2020 01:06
Show Gist options
  • Save anvodev/cbca49857c8c7cceec8b437a1d42fbd9 to your computer and use it in GitHub Desktop.
Save anvodev/cbca49857c8c7cceec8b437a1d42fbd9 to your computer and use it in GitHub Desktop.
<?php
//coffee_shop_another_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 another day
$milk = new Milk();
$coffee = new MilkCoffee($milk);
$consumer = new AtCoffeeShopConsumer($coffee);
$consumer->readyToWork();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment