Skip to content

Instantly share code, notes, and snippets.

@nahidulhasan
Last active September 27, 2021 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nahidulhasan/8655cf06c770bc8af5ffbe4ea3ce7a80 to your computer and use it in GitHub Desktop.
Save nahidulhasan/8655cf06c770bc8af5ffbe4ea3ce7a80 to your computer and use it in GitHub Desktop.
<?php
class Tea
{
public function addTea()
{
var_dump('Add proper amount of tea');
return $this;
}
protected function addHotWater()
{
var_dump('Pour Hot water into cup');
return $this;
}
protected function addSugar()
{
var_dump('Add proper amount of sugar');
return $this;
}
protected function addMilk()
{
var_dump('Add proper amount of Milk');
return $this;
}
public function make()
{
return $this
->addHotWater()
->addSugar()
->addTea()
->addMilk();
}
}
$tea = new Tea();
$tea->make();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment