Created
August 9, 2016 12:00
-
-
Save mpociot/c17cae18e1663efad2fd439ece26b92c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| namespace Mpociot\SlackBot; | |
| class PizzaConversation extends Conversation | |
| { | |
| protected $size; | |
| protected $topping; | |
| public function askSize() | |
| { | |
| return $this->ask('What size do you want?', function($answer){ | |
| $this->size = $answer; | |
| $this->reply('Okay - you get a '.$answer.' pizza.'); | |
| $this->askFlavor(); | |
| }); | |
| } | |
| public function askFlavor() | |
| { | |
| return $this->ask('What topping do you want?', function($answer){ | |
| $this->reply('Okay - you get '.$answer.' on top of your '.$this->size.' pizza.'); | |
| }); | |
| } | |
| public function run() | |
| { | |
| $this->askSize(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment