Enable Message objects instead of strings
masterBy default, the receive() method on a WebSocket\Client or WebSocket\Server returns a string. To receive structured WebSocket\Message\Message instances instead, you must set the return_obj option to true during instantiation.
When enabled, the returned object will be an instance of a specific class corresponding to the WebSocket opcode:
WebSocket\Message\TextWebSocket\Message\BinaryWebSocket\Message\PingWebSocket\Message\PongWebSocket\Message\Close
$client = new WebSocket\Client('ws://example.com/', ['return_obj' => true]);
$message = $client->receive(); // Returns a Message object