@@ -20,7 +20,7 @@ trait HandlesConversations
20
20
*/
21
21
public function startConversation (Conversation $ instance , $ recipient = null , $ driver = null )
22
22
{
23
- if (! is_null ($ recipient ) && ! is_null ($ driver )) {
23
+ if (!is_null ($ recipient ) && !is_null ($ driver )) {
24
24
$ this ->message = new IncomingMessage ('' , $ recipient , '' , null , $ this ->config ['bot_id ' ]);
25
25
$ this ->driver = DriverManager::loadFromName ($ driver , $ this ->config );
26
26
}
@@ -74,7 +74,7 @@ public function getStoredConversation($message = null)
74
74
*/
75
75
public function touchCurrentConversation ()
76
76
{
77
- if (! is_null ($ this ->currentConversationData )) {
77
+ if (!is_null ($ this ->currentConversationData )) {
78
78
$ touched = $ this ->currentConversationData ;
79
79
$ touched ['time ' ] = microtime ();
80
80
@@ -119,7 +119,7 @@ public function removeStoredConversation($message = null)
119
119
*/
120
120
public function serializeClosure (Closure $ closure )
121
121
{
122
- if ($ this ->getDriver ()->serializesCallbacks () && ! $ this ->runsOnSocket ) {
122
+ if ($ this ->getDriver ()->serializesCallbacks () && !$ this ->runsOnSocket ) {
123
123
return serialize (new SerializableClosure ($ closure , true ));
124
124
}
125
125
@@ -132,7 +132,7 @@ public function serializeClosure(Closure $closure)
132
132
*/
133
133
protected function unserializeClosure ($ closure )
134
134
{
135
- if ($ this ->getDriver ()->serializesCallbacks () && ! $ this ->runsOnSocket ) {
135
+ if ($ this ->getDriver ()->serializesCallbacks () && !$ this ->runsOnSocket ) {
136
136
return unserialize ($ closure );
137
137
}
138
138
@@ -258,7 +258,7 @@ protected function callConversation($next, $convo, IncomingMessage $message, arr
258
258
{
259
259
/** @var \BotMan\BotMan\Messages\Conversations\Conversation $conversation */
260
260
$ conversation = $ convo ['conversation ' ];
261
- if (! $ conversation instanceof ShouldQueue) {
261
+ if (!$ conversation instanceof ShouldQueue) {
262
262
$ conversation ->setBot ($ this );
263
263
}
264
264
/*
@@ -303,6 +303,11 @@ protected function prepareConversationClosure($next, Conversation $conversation,
303
303
}
304
304
305
305
$ parameters [] = $ conversation ;
306
- call_user_func_array ($ next , $ parameters );
306
+
307
+ if (class_exists ('Illuminate \\Support \\Facades \\App ' )) {
308
+ \Illuminate \Support \Facades \App::call ($ next , $ parameters );
309
+ } else {
310
+ call_user_func_array ($ next , $ parameters );
311
+ }
307
312
}
308
313
}
0 commit comments