Last active
September 27, 2021 15:32
-
-
Save nahidulhasan/8655cf06c770bc8af5ffbe4ea3ce7a80 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 | |
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