From 2985e901e07b725ba4baa88037e7950e5bf8cb15 Mon Sep 17 00:00:00 2001 From: Milan Rukavina Date: Thu, 10 Sep 2015 20:18:04 +0200 Subject: [PATCH] constructorParams fix --- src/MgKurentoClient/JsonRpc/Client.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/MgKurentoClient/JsonRpc/Client.php b/src/MgKurentoClient/JsonRpc/Client.php index 212989f..5dc8e38 100644 --- a/src/MgKurentoClient/JsonRpc/Client.php +++ b/src/MgKurentoClient/JsonRpc/Client.php @@ -106,10 +106,13 @@ public function receive($data){ * @return mixed */ public function sendCreate($type, $creationParams, callable $callback){ - return $this->send('create', array( - 'type' => $type, - 'constructorParams' => $creationParams - ), $callback); + $message = array( + 'type' => $type + ); + if(isset($creationParams) && count($creationParams)){ + $message['constructorParams'] = $creationParams; + } + return $this->send('create', $message, $callback); } /**