Skip to content

Commit 92698ed

Browse files
committed
Added dialogs return
1 parent a2f6b89 commit 92698ed

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/Dialog.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ public function __construct(QueryApi $queryApi, ActionMapping $actionMapping)
4343
* @param string $sessionId
4444
* @param string $message
4545
* @param string $lang
46+
*
47+
* @return bool|void
4648
*/
4749
public function create($sessionId, $message, $lang = Client::DEFAULT_API_LANGUAGE)
4850
{
4951
try {
5052
$step = $this->getStep($sessionId, $message, $lang);
5153
} catch (\Exception $error) {
52-
$this->actionMapping->error($sessionId, $error);
53-
54-
return;
54+
return $this->actionMapping->error($sessionId, $error);
5555
}
5656

57-
$this->performStep($sessionId, $step);
57+
return $this->performStep($sessionId, $step);
5858
}
5959

6060
/**
@@ -92,17 +92,21 @@ private function getStep($sessionId, $message, $lang)
9292
/**
9393
* @param string $sessionId
9494
* @param Step $step
95+
*
96+
* @return bool
9597
*/
9698
private function performStep($sessionId, Step $step)
9799
{
98100
switch (true) {
99101
case $step instanceof Action:
100-
$this->actionMapping->action($sessionId, $step->getAction(), $step->getParameters());
102+
return $this->actionMapping->action($sessionId, $step->getAction(), $step->getParameters());
101103
break;
102104
case $step instanceof Speech:
103-
$this->actionMapping->speech($sessionId, $step->getSpeech());
105+
return $this->actionMapping->speech($sessionId, $step->getSpeech());
104106
break;
105107
}
108+
109+
return false;
106110
}
107111

108112
}

0 commit comments

Comments
 (0)