File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -68,4 +68,4 @@ public function handle()
6868
6969 $ loop ->run ();
7070 }
71- }
71+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class ConsoleDriver implements DriverInterface
2323 /** @var string */
2424 protected $ bot_id ;
2525
26- /** @var boolean */
26+ /** @var bool */
2727 protected $ hasQuestion = false ;
2828
2929 /** @var array */
@@ -75,15 +75,17 @@ public function matchesRequest()
7575 */
7676 public function getConversationAnswer (IncomingMessage $ message )
7777 {
78- $ index = (int )$ message ->getText () - 1 ;
78+ $ index = (int ) $ message ->getText () - 1 ;
7979
8080 if ($ this ->hasQuestion && isset ($ this ->lastQuestions [$ index ])) {
8181 $ question = $ this ->lastQuestions [$ index ];
82+
8283 return Answer::create ($ question ['name ' ])
8384 ->setInteractiveReply (true )
8485 ->setValue ($ question ['value ' ])
8586 ->setMessage ($ message );
8687 }
88+
8789 return Answer::create ($ this ->message )->setMessage ($ message );
8890 }
8991
@@ -163,9 +165,9 @@ public function sendPayload($payload)
163165 $ questionData = $ payload ['questionData ' ];
164166 $ this ->client ->writeln (self ::BOT_NAME .': ' .$ payload ['text ' ]);
165167
166- if (!is_null ($ questionData )) {
168+ if (! is_null ($ questionData )) {
167169 foreach ($ questionData ['actions ' ] as $ key => $ action ) {
168- $ this ->client ->writeln (($ key+ 1 ).') ' .$ action ['text ' ]);
170+ $ this ->client ->writeln (($ key + 1 ).') ' .$ action ['text ' ]);
169171 }
170172 $ this ->hasQuestion = true ;
171173 $ this ->lastQuestions = $ questionData ['actions ' ];
Original file line number Diff line number Diff line change 11<?php
2+
23namespace BotMan \Tinker ;
34
45use BotMan \Tinker \Commands \Tinker ;
56use Illuminate \Support \ServiceProvider ;
67
78class TinkerServiceProvider extends ServiceProvider
89{
9-
1010 public function register ()
1111 {
1212 $ this ->commands ([
13- Tinker::class
13+ Tinker::class,
1414 ]);
1515 }
16-
17- }
16+ }
You can’t perform that action at this time.
0 commit comments