json decode now to array

This commit is contained in:
Ruben 2016-11-03 11:14:31 +01:00
parent e02a7a7d3e
commit a451bf2af5

View file

@ -31,7 +31,7 @@ class Websockets implements MessageComponentInterface
echo sprintf('Connection %d sending message "%s"' . "\n" echo sprintf('Connection %d sending message "%s"' . "\n"
, $from->resourceId, $msg); , $from->resourceId, $msg);
$data = @json_decode($msg); $data = @json_decode($msg, true);
if(!empty($data) && $data['action'] == 'update' && isset($data['method'])) if(!empty($data) && $data['action'] == 'update' && isset($data['method']))
{ {
foreach ($this->clients as $client) { foreach ($this->clients as $client) {