@@ -43,18 +43,18 @@ public function __construct(QueryApi $queryApi, ActionMapping $actionMapping)
43
43
* @param string $sessionId
44
44
* @param string $message
45
45
* @param string $lang
46
+ *
47
+ * @return bool|void
46
48
*/
47
49
public function create ($ sessionId , $ message , $ lang = Client::DEFAULT_API_LANGUAGE )
48
50
{
49
51
try {
50
52
$ step = $ this ->getStep ($ sessionId , $ message , $ lang );
51
53
} catch (\Exception $ error ) {
52
- $ this ->actionMapping ->error ($ sessionId , $ error );
53
-
54
- return ;
54
+ return $ this ->actionMapping ->error ($ sessionId , $ error );
55
55
}
56
56
57
- $ this ->performStep ($ sessionId , $ step );
57
+ return $ this ->performStep ($ sessionId , $ step );
58
58
}
59
59
60
60
/**
@@ -92,17 +92,21 @@ private function getStep($sessionId, $message, $lang)
92
92
/**
93
93
* @param string $sessionId
94
94
* @param Step $step
95
+ *
96
+ * @return bool
95
97
*/
96
98
private function performStep ($ sessionId , Step $ step )
97
99
{
98
100
switch (true ) {
99
101
case $ step instanceof Action:
100
- $ this ->actionMapping ->action ($ sessionId , $ step ->getAction (), $ step ->getParameters ());
102
+ return $ this ->actionMapping ->action ($ sessionId , $ step ->getAction (), $ step ->getParameters ());
101
103
break ;
102
104
case $ step instanceof Speech:
103
- $ this ->actionMapping ->speech ($ sessionId , $ step ->getSpeech ());
105
+ return $ this ->actionMapping ->speech ($ sessionId , $ step ->getSpeech ());
104
106
break ;
105
107
}
108
+
109
+ return false ;
106
110
}
107
111
108
112
}
0 commit comments