Skip to content

Instantly share code, notes, and snippets.

@anvodev
Last active June 4, 2020 00:58
Show Gist options
  • Select an option

  • Save anvodev/0b1233910a5b5d683fbbac83faced182 to your computer and use it in GitHub Desktop.

Select an option

Save anvodev/0b1233910a5b5d683fbbac83faced182 to your computer and use it in GitHub Desktop.
<?php
//coffee_shop_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
$egg = new Egg();
$coffee = new EggCoffee($egg);
$consumer = new AtCoffeeShopConsumer($coffee);
$consumer->readyToWork();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment