Be aware that this JsonEncoder class would have to have a method `serialize($data, $format)`, which IMO doesn't really make sense, since you only want json output. 
So for the pusher-php-server I would go for an interface with just `serialize($data)`. 
In the LopiPusherBundle this could optionally be replaced with a class wrapping around the JMS Serializer.