How to get the received data from onMessage in another class?
server.php
```
use Ratchet\Http\HttpServer;
use Ratchet\Server\IoServer;
use Ratchet\WebSocket\WsServer;

require '../../../../vendor/autoload.php';
include_once 'main.php';

class Server {
    public function __construct(){
        $this->init();
    }
    public function init(){
        $server = IoServer::factory(
            new HttpServer(
                new WsServer(
                     Main::instance())),3000);
        $server->run();
    }
} new Server();

```
main.php
```
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;

class Main implements MessageComponentInterface, WsServerInterface
{
    protected $clients;
    protected $message;

    public function __construct()
    {
        $this->clients = new \SplObjectStorage();
    }

    private function __clone()
    {
        // Make sure that nobody can clone instance
    }

    public function onOpen (ConnectionInterface $conn)
    {
        $this->clients->attach($conn);
        echo "New Connection!! ({$conn->resourceId})\n";
    }
    public function onMessage(ConnectionInterface $from, $msg)
    {
        $this->message = $msg;
    }

    public function getMessages(){
        if ($this->message == null)
            return $this->message.'nothing to see';
        else
        return $this->message.' here you messages';
    }

    public function onClose(ConnectionInterface $conn)
    {
        $this->clients->detach($conn);
    }

    public function onError(ConnectionInterface $conn, \Exception $e)
    {
        echo "An error has occured: {$e->getMessage()}\n";
        $conn->close();
    }

    public function getSubProtocols()
    {
        return ['someSubPr'];
    }

    public static function instance(){ //to make sure there's only one instance of it
        static $instance = false;
        if($instance === false){
            $instance = new static();
        }
        return $instance;
    }
}
```
and the class where I want to handle received data:
data.php
```
class DATA extends Controller
{
    public function dispatchAction(){

        // start onMessage ...
        $test = Main::instance()->getMessages();
        var_dump('- ' . $test . ' -');  //here I receive nothing
    }
}
```
What's wrong?