title: PHP Fatal error: Class 'MyApp\Socket' not found
body: <p>I also have an error of this type in this simple project..
  The structure is:</p>
  
  <pre><code>app.php
  composer.json
  +--app/
     socket.php
  +--vendor/
  ...
  </code></pre>
  
  <p>When I run 'php app.php' I get the error:</p>
  
  <pre><code>PHP Fatal error:  Class 'MyApp\Socket' not found in /home/amtek/msgserver/app.php on line 19
  </code></pre>
  
  <p>app.php:</p>
  
  <pre><code>&lt;?php
     require dirname( __FILE__ ) . '/vendor/autoload.php';
     ...
     use MyApp\Socket;
  
     $server = IoServer::factory( new HttpServer( new WsServer( new Socket())), 8090 );
     $server-&gt;run();
  </code></pre>
  
  <p>./app/socket.php:</p>
  
  <pre><code>&lt;?php
   namespace MyApp;
  
   use Ratchet\MessageComponentInterface;
   use Ratchet\ConnectionInterface;
  
   class Socket implements MessageComponentInterface {
   ...
  </code></pre>
  
  <p>composer.json:</p>
  
  <pre><code>{
      "autoload": {
        "psr-4": {
          "MyApp\\": "app"
        }
  },
  "require": {
      "cboden/ratchet": "^0.4"
  }
  }
  </code></pre>